Option Explicit On
Option Strict Off

'*******************************************************************
' Program: Data Center Visio Rack Tool
' Author: Albert E Edlund
' Date:
'
' Purpose: this form is the ICMP interface (ping, stepped ping, trace
' route. 
'
'*********************************************************************


' basic system calls
Imports System
Imports System.Windows.Forms
Imports System.Text
Imports System.Data
Imports System.Threading
Imports System.Timers
Imports System.Drawing
Imports System.Drawing.Image
Imports System.Drawing.Imaging
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices

Imports Charting = System.Windows.Forms.DataVisualization.Charting

' for the clsping functions
Imports System.Net
Imports System.Net.Sockets
Imports System.Net.NetworkInformation

Imports System.IO
Imports System.Xml
Imports System.Xml.Serialization



' for the visio references
Imports Microsoft.Office.Interop.Visio
Imports Microsoft.Office.Interop.Visio.VisOpenSaveArgs
Imports Microsoft.Office.Interop.Visio.VisSectionIndices
Imports Microsoft.Office.Interop.Visio.VisCellVals
Imports Microsoft.Office.Interop.Visio.VisCellIndices
Imports Microsoft.Office.Interop.Visio.VisFieldCategories
Imports Microsoft.Office.Interop.Visio.VisFieldCodes
Imports Microsoft.Office.Interop.Visio.VisFieldFormats
Imports Microsoft.Office.Interop.Visio.VisUniqueIDArgs
Imports Microsoft.Office.Interop.Visio.VisRowIndices
Imports Microsoft.Office.Interop.Visio.VisUICmds
Imports Microsoft.Office.Interop.Visio.VisSelectArgs


' the exception handling and logging
Imports Microsoft.Practices.EnterpriseLibrary.Common
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging

Imports visRackSysMgmt.clsVisioSupport
Imports visRackSysMgmt
Imports visRackSysMgmt.clsAttrNetwork

Imports visRackSysMgmt.IcmpResults
Imports visRackSysMgmt.IcmpResults.IcmpPingResults
Imports visRackSysMgmt.IcmpResults.IcmpStepPingResult
Imports visRackSysMgmt.IcmpResults.IcmpTraceRouteResult
Imports visRackSysMgmt.IcmpResults.ICMPPingDevice
' for the reporting
Imports visRackSysMgmt.frmReportViewer
Imports visRackSysMgmt.clsDC_RackReporting

Imports System.Windows.Forms.DataVisualization.Charting

Imports Microsoft.Office.Interop.VisOcx


Public Class frmICMPMgmt
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "


    Friend WithEvents chkReverseLookup As System.Windows.Forms.CheckBox
    Friend WithEvents dlvPingResult As System.Windows.Forms.ListView
    Friend WithEvents grpReports As System.Windows.Forms.GroupBox
    Friend WithEvents optTable As System.Windows.Forms.RadioButton
    Friend WithEvents optChart As System.Windows.Forms.RadioButton
    Friend WithEvents tbNetStatus As System.Windows.Forms.TabPage
    Friend WithEvents cmdUpdateNetStatus As System.Windows.Forms.Button
    Friend WithEvents cmdTestPath As System.Windows.Forms.Button
    Friend WithEvents cmdTraceRt As System.Windows.Forms.Button
    Friend WithEvents cmdSteppedPing As System.Windows.Forms.Button
    Friend WithEvents cmdStart As System.Windows.Forms.Button
    Friend WithEvents lblIPTarget As System.Windows.Forms.Label
    Friend WithEvents txtIPTarget As System.Windows.Forms.TextBox
    Friend WithEvents dlvSelectedShapes As System.Windows.Forms.ListView
    Friend WithEvents cmdTRReport As System.Windows.Forms.Button
    Friend WithEvents txtTraceRt_Target As System.Windows.Forms.TextBox
    Friend WithEvents lblTarget As System.Windows.Forms.Label
    Friend WithEvents dlvSteppedPing As System.Windows.Forms.ListView
    Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip
    Friend WithEvents colIcmpSelected As System.Windows.Forms.ColumnHeader
    Friend WithEvents colIcmpIpAddress As System.Windows.Forms.ColumnHeader
    Friend WithEvents colIcmpLastStatus As System.Windows.Forms.ColumnHeader
    Friend WithEvents StatusLabel1 As System.Windows.Forms.ToolStripStatusLabel
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents cmdBuildSpReport As System.Windows.Forms.Button
    Friend WithEvents axdrawTraceDisplay As AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
    Private WithEvents axchartSteppedPing As System.Windows.Forms.DataVisualization.Charting.Chart
    Friend WithEvents grpChart As System.Windows.Forms.GroupBox
    Friend WithEvents cmdCopySpChart As System.Windows.Forms.Button
    Private WithEvents checkBoxShowChartArea2 As System.Windows.Forms.CheckBox
    Private WithEvents checkBoxShowChartArea1 As System.Windows.Forms.CheckBox
    Private WithEvents AlignmentCombo As System.Windows.Forms.ComboBox
    Private WithEvents label12 As System.Windows.Forms.Label
    Friend WithEvents dlvTraceRoute As System.Windows.Forms.ListView


    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    Friend WithEvents tbPingConf As System.Windows.Forms.TabPage
    Friend WithEvents tbTraceRt As System.Windows.Forms.TabPage
    Public WithEvents tbSteppedPing As System.Windows.Forms.TabPage
    Friend WithEvents cmdClose As System.Windows.Forms.Button
    Friend WithEvents lblPingSubmitted As System.Windows.Forms.Label
    Friend WithEvents lblSubmitted As System.Windows.Forms.Label
    Friend WithEvents lblPingOutstanding As System.Windows.Forms.Label
    Friend WithEvents lblOutstanding As System.Windows.Forms.Label
    Friend WithEvents grpParameters As System.Windows.Forms.GroupBox
    Friend WithEvents lblPingLimit As System.Windows.Forms.Label
    Friend WithEvents txtPingLimit As System.Windows.Forms.TextBox
    Friend WithEvents lblTimeout As System.Windows.Forms.Label
    Friend WithEvents txtTimeout As System.Windows.Forms.TextBox
    Friend WithEvents chkReplies As System.Windows.Forms.CheckBox
    Friend WithEvents lblFrameSize As System.Windows.Forms.Label
    Friend WithEvents lblTTL As System.Windows.Forms.Label
    Friend WithEvents txtTTL As System.Windows.Forms.TextBox
    Friend WithEvents lstFrameSize As System.Windows.Forms.ListBox
    Friend WithEvents txtStepPingSize As System.Windows.Forms.TextBox
    Friend WithEvents lblTextPingCaveat As System.Windows.Forms.Label
    Friend WithEvents chkDrawTrace As System.Windows.Forms.CheckBox
    Friend WithEvents lblAutoSteppedPing As System.Windows.Forms.Label
    Friend WithEvents Timer2 As System.Windows.Forms.Timer
    Friend WithEvents chkSteppedPingEnabled As System.Windows.Forms.CheckBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents txtPingDelay As System.Windows.Forms.TextBox
    Friend WithEvents lblSPingSize As System.Windows.Forms.Label
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents lblCurrTime As System.Windows.Forms.Label
    Friend WithEvents lblCurrStep As System.Windows.Forms.Label
    Friend WithEvents lblTraceRt_IPAddress As System.Windows.Forms.Label
    Friend WithEvents tbVisio As System.Windows.Forms.TabPage
    Friend WithEvents cmdPanZoom As System.Windows.Forms.Button
    Friend WithEvents cmdCopyVisio As System.Windows.Forms.Button
    Friend WithEvents lblTraceRt_Name As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim ChartArea1 As System.Windows.Forms.DataVisualization.Charting.ChartArea = New System.Windows.Forms.DataVisualization.Charting.ChartArea()
        Dim ChartArea2 As System.Windows.Forms.DataVisualization.Charting.ChartArea = New System.Windows.Forms.DataVisualization.Charting.ChartArea()
        Dim Legend1 As System.Windows.Forms.DataVisualization.Charting.Legend = New System.Windows.Forms.DataVisualization.Charting.Legend()
        Dim Series1 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series()
        Dim DataPoint1 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 3.0R)
        Dim DataPoint2 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 7.0R)
        Dim DataPoint3 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 8.0R)
        Dim DataPoint4 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 6.0R)
        Dim DataPoint5 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 7.0R)
        Dim Series2 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series()
        Dim DataPoint6 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 4.0R)
        Dim DataPoint7 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 7.0R)
        Dim DataPoint8 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 5.0R)
        Dim DataPoint9 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 8.0R)
        Dim DataPoint10 As System.Windows.Forms.DataVisualization.Charting.DataPoint = New System.Windows.Forms.DataVisualization.Charting.DataPoint(0.0R, 6.0R)
        Dim Series3 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series()
        Dim Series4 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series()
        Dim Title1 As System.Windows.Forms.DataVisualization.Charting.Title = New System.Windows.Forms.DataVisualization.Charting.Title()
        Dim Title2 As System.Windows.Forms.DataVisualization.Charting.Title = New System.Windows.Forms.DataVisualization.Charting.Title()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmICMPMgmt))
        Me.TabControl1 = New System.Windows.Forms.TabControl()
        Me.tbNetStatus = New System.Windows.Forms.TabPage()
        Me.txtTraceRt_Target = New System.Windows.Forms.TextBox()
        Me.lblTarget = New System.Windows.Forms.Label()
        Me.cmdUpdateNetStatus = New System.Windows.Forms.Button()
        Me.cmdTestPath = New System.Windows.Forms.Button()
        Me.cmdTraceRt = New System.Windows.Forms.Button()
        Me.cmdSteppedPing = New System.Windows.Forms.Button()
        Me.cmdStart = New System.Windows.Forms.Button()
        Me.lblIPTarget = New System.Windows.Forms.Label()
        Me.txtIPTarget = New System.Windows.Forms.TextBox()
        Me.dlvSelectedShapes = New System.Windows.Forms.ListView()
        Me.colIcmpSelected = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        Me.colIcmpIpAddress = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        Me.colIcmpLastStatus = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        Me.tbPingConf = New System.Windows.Forms.TabPage()
        Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
        Me.StatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel()
        Me.dlvPingResult = New System.Windows.Forms.ListView()
        Me.chkReverseLookup = New System.Windows.Forms.CheckBox()
        Me.chkReplies = New System.Windows.Forms.CheckBox()
        Me.grpParameters = New System.Windows.Forms.GroupBox()
        Me.txtPingDelay = New System.Windows.Forms.TextBox()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.lstFrameSize = New System.Windows.Forms.ListBox()
        Me.txtTTL = New System.Windows.Forms.TextBox()
        Me.lblTTL = New System.Windows.Forms.Label()
        Me.lblFrameSize = New System.Windows.Forms.Label()
        Me.txtTimeout = New System.Windows.Forms.TextBox()
        Me.lblTimeout = New System.Windows.Forms.Label()
        Me.txtPingLimit = New System.Windows.Forms.TextBox()
        Me.lblPingLimit = New System.Windows.Forms.Label()
        Me.lblOutstanding = New System.Windows.Forms.Label()
        Me.lblPingOutstanding = New System.Windows.Forms.Label()
        Me.lblSubmitted = New System.Windows.Forms.Label()
        Me.lblPingSubmitted = New System.Windows.Forms.Label()
        Me.tbSteppedPing = New System.Windows.Forms.TabPage()
        Me.grpChart = New System.Windows.Forms.GroupBox()
        Me.cmdCopySpChart = New System.Windows.Forms.Button()
        Me.checkBoxShowChartArea2 = New System.Windows.Forms.CheckBox()
        Me.checkBoxShowChartArea1 = New System.Windows.Forms.CheckBox()
        Me.AlignmentCombo = New System.Windows.Forms.ComboBox()
        Me.label12 = New System.Windows.Forms.Label()
        Me.axchartSteppedPing = New System.Windows.Forms.DataVisualization.Charting.Chart()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.dlvSteppedPing = New System.Windows.Forms.ListView()
        Me.grpReports = New System.Windows.Forms.GroupBox()
        Me.cmdBuildSpReport = New System.Windows.Forms.Button()
        Me.optChart = New System.Windows.Forms.RadioButton()
        Me.optTable = New System.Windows.Forms.RadioButton()
        Me.txtStepPingCt = New System.Windows.Forms.TextBox()
        Me.lblSPingSize = New System.Windows.Forms.Label()
        Me.chkSteppedPingEnabled = New System.Windows.Forms.CheckBox()
        Me.lblTextPingCaveat = New System.Windows.Forms.Label()
        Me.txtStepPingSize = New System.Windows.Forms.TextBox()
        Me.tbTraceRt = New System.Windows.Forms.TabPage()
        Me.cmdTRReport = New System.Windows.Forms.Button()
        Me.dlvTraceRoute = New System.Windows.Forms.ListView()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.lblCurrTime = New System.Windows.Forms.Label()
        Me.lblCurrStep = New System.Windows.Forms.Label()
        Me.lblTraceRt_IPAddress = New System.Windows.Forms.Label()
        Me.lblTraceRt_Name = New System.Windows.Forms.Label()
        Me.lblAutoSteppedPing = New System.Windows.Forms.Label()
        Me.chkDrawTrace = New System.Windows.Forms.CheckBox()
        Me.tbVisio = New System.Windows.Forms.TabPage()
        Me.axdrawTraceDisplay = New AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl()
        Me.cmdCopyVisio = New System.Windows.Forms.Button()
        Me.cmdPanZoom = New System.Windows.Forms.Button()
        Me.cmdClose = New System.Windows.Forms.Button()
        Me.Timer2 = New System.Windows.Forms.Timer(Me.components)
        Me.TabControl1.SuspendLayout()
        Me.tbNetStatus.SuspendLayout()
        Me.tbPingConf.SuspendLayout()
        Me.StatusStrip1.SuspendLayout()
        Me.grpParameters.SuspendLayout()
        Me.tbSteppedPing.SuspendLayout()
        Me.grpChart.SuspendLayout()
        CType(Me.axchartSteppedPing, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.grpReports.SuspendLayout()
        Me.tbTraceRt.SuspendLayout()
        Me.GroupBox1.SuspendLayout()
        Me.tbVisio.SuspendLayout()
        CType(Me.axdrawTraceDisplay, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'TabControl1
        '
        Me.TabControl1.Controls.Add(Me.tbNetStatus)
        Me.TabControl1.Controls.Add(Me.tbPingConf)
        Me.TabControl1.Controls.Add(Me.tbSteppedPing)
        Me.TabControl1.Controls.Add(Me.tbTraceRt)
        Me.TabControl1.Controls.Add(Me.tbVisio)
        Me.TabControl1.Location = New System.Drawing.Point(8, 8)
        Me.TabControl1.Name = "TabControl1"
        Me.TabControl1.SelectedIndex = 0
        Me.TabControl1.Size = New System.Drawing.Size(684, 420)
        Me.TabControl1.TabIndex = 1
        '
        'tbNetStatus
        '
        Me.tbNetStatus.Controls.Add(Me.txtTraceRt_Target)
        Me.tbNetStatus.Controls.Add(Me.lblTarget)
        Me.tbNetStatus.Controls.Add(Me.cmdUpdateNetStatus)
        Me.tbNetStatus.Controls.Add(Me.cmdTestPath)
        Me.tbNetStatus.Controls.Add(Me.cmdTraceRt)
        Me.tbNetStatus.Controls.Add(Me.cmdSteppedPing)
        Me.tbNetStatus.Controls.Add(Me.cmdStart)
        Me.tbNetStatus.Controls.Add(Me.lblIPTarget)
        Me.tbNetStatus.Controls.Add(Me.txtIPTarget)
        Me.tbNetStatus.Controls.Add(Me.dlvSelectedShapes)
        Me.tbNetStatus.Location = New System.Drawing.Point(4, 22)
        Me.tbNetStatus.Name = "tbNetStatus"
        Me.tbNetStatus.Padding = New System.Windows.Forms.Padding(3)
        Me.tbNetStatus.Size = New System.Drawing.Size(676, 394)
        Me.tbNetStatus.TabIndex = 5
        Me.tbNetStatus.Text = "NetworkStatus"
        Me.tbNetStatus.UseVisualStyleBackColor = True
        '
        'txtTraceRt_Target
        '
        Me.txtTraceRt_Target.Location = New System.Drawing.Point(94, 118)
        Me.txtTraceRt_Target.Name = "txtTraceRt_Target"
        Me.txtTraceRt_Target.Size = New System.Drawing.Size(108, 20)
        Me.txtTraceRt_Target.TabIndex = 20
        Me.txtTraceRt_Target.Text = "www.yahoo.com"
        '
        'lblTarget
        '
        Me.lblTarget.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblTarget.Location = New System.Drawing.Point(13, 122)
        Me.lblTarget.Name = "lblTarget"
        Me.lblTarget.Size = New System.Drawing.Size(87, 16)
        Me.lblTarget.TabIndex = 19
        Me.lblTarget.Text = "Trace Route Target"
        '
        'cmdUpdateNetStatus
        '
        Me.cmdUpdateNetStatus.Location = New System.Drawing.Point(16, 222)
        Me.cmdUpdateNetStatus.Name = "cmdUpdateNetStatus"
        Me.cmdUpdateNetStatus.Size = New System.Drawing.Size(64, 43)
        Me.cmdUpdateNetStatus.TabIndex = 18
        Me.cmdUpdateNetStatus.Text = "Update Status"
        '
        'cmdTestPath
        '
        Me.cmdTestPath.Location = New System.Drawing.Point(16, 144)
        Me.cmdTestPath.Name = "cmdTestPath"
        Me.cmdTestPath.Size = New System.Drawing.Size(64, 32)
        Me.cmdTestPath.TabIndex = 17
        Me.cmdTestPath.Text = "Test Path"
        '
        'cmdTraceRt
        '
        Me.cmdTraceRt.Enabled = False
        Me.cmdTraceRt.Location = New System.Drawing.Point(109, 144)
        Me.cmdTraceRt.Name = "cmdTraceRt"
        Me.cmdTraceRt.Size = New System.Drawing.Size(64, 32)
        Me.cmdTraceRt.TabIndex = 16
        Me.cmdTraceRt.Text = "TraceRt"
        '
        'cmdSteppedPing
        '
        Me.cmdSteppedPing.Location = New System.Drawing.Point(109, 66)
        Me.cmdSteppedPing.Name = "cmdSteppedPing"
        Me.cmdSteppedPing.Size = New System.Drawing.Size(64, 32)
        Me.cmdSteppedPing.TabIndex = 15
        Me.cmdSteppedPing.Text = "StepPing"
        '
        'cmdStart
        '
        Me.cmdStart.Location = New System.Drawing.Point(17, 66)
        Me.cmdStart.Name = "cmdStart"
        Me.cmdStart.Size = New System.Drawing.Size(64, 32)
        Me.cmdStart.TabIndex = 13
        Me.cmdStart.Text = "Ping"
        '
        'lblIPTarget
        '
        Me.lblIPTarget.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblIPTarget.Location = New System.Drawing.Point(15, 32)
        Me.lblIPTarget.Name = "lblIPTarget"
        Me.lblIPTarget.Size = New System.Drawing.Size(56, 24)
        Me.lblIPTarget.TabIndex = 8
        Me.lblIPTarget.Text = "IP Target"
        '
        'txtIPTarget
        '
        Me.txtIPTarget.Location = New System.Drawing.Point(77, 30)
        Me.txtIPTarget.Name = "txtIPTarget"
        Me.txtIPTarget.Size = New System.Drawing.Size(112, 20)
        Me.txtIPTarget.TabIndex = 7
        Me.txtIPTarget.Text = "69.147.76.15"
        '
        'dlvSelectedShapes
        '
        Me.dlvSelectedShapes.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.colIcmpSelected, Me.colIcmpIpAddress, Me.colIcmpLastStatus})
        Me.dlvSelectedShapes.Location = New System.Drawing.Point(219, 66)
        Me.dlvSelectedShapes.Name = "dlvSelectedShapes"
        Me.dlvSelectedShapes.Size = New System.Drawing.Size(425, 252)
        Me.dlvSelectedShapes.TabIndex = 0
        Me.dlvSelectedShapes.UseCompatibleStateImageBehavior = False
        Me.dlvSelectedShapes.View = System.Windows.Forms.View.Details
        '
        'colIcmpSelected
        '
        Me.colIcmpSelected.Text = "Shape Name"
        Me.colIcmpSelected.Width = 100
        '
        'colIcmpIpAddress
        '
        Me.colIcmpIpAddress.Text = "Ip Address"
        Me.colIcmpIpAddress.Width = 100
        '
        'colIcmpLastStatus
        '
        Me.colIcmpLastStatus.Text = "Last Status"
        Me.colIcmpLastStatus.Width = 200
        '
        'tbPingConf
        '
        Me.tbPingConf.Controls.Add(Me.StatusStrip1)
        Me.tbPingConf.Controls.Add(Me.dlvPingResult)
        Me.tbPingConf.Controls.Add(Me.chkReverseLookup)
        Me.tbPingConf.Controls.Add(Me.chkReplies)
        Me.tbPingConf.Controls.Add(Me.grpParameters)
        Me.tbPingConf.Controls.Add(Me.lblOutstanding)
        Me.tbPingConf.Controls.Add(Me.lblPingOutstanding)
        Me.tbPingConf.Controls.Add(Me.lblSubmitted)
        Me.tbPingConf.Controls.Add(Me.lblPingSubmitted)
        Me.tbPingConf.Location = New System.Drawing.Point(4, 22)
        Me.tbPingConf.Name = "tbPingConf"
        Me.tbPingConf.Size = New System.Drawing.Size(676, 394)
        Me.tbPingConf.TabIndex = 1
        Me.tbPingConf.Text = "Ping Setup"
        Me.tbPingConf.UseVisualStyleBackColor = True
        '
        'StatusStrip1
        '
        Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.StatusLabel1})
        Me.StatusStrip1.Location = New System.Drawing.Point(0, 372)
        Me.StatusStrip1.Name = "StatusStrip1"
        Me.StatusStrip1.Size = New System.Drawing.Size(676, 22)
        Me.StatusStrip1.TabIndex = 16
        Me.StatusStrip1.Text = "StatusStrip1"
        '
        'StatusLabel1
        '
        Me.StatusLabel1.AutoSize = False
        Me.StatusLabel1.Name = "StatusLabel1"
        Me.StatusLabel1.Size = New System.Drawing.Size(121, 17)
        '
        'dlvPingResult
        '
        Me.dlvPingResult.Location = New System.Drawing.Point(255, 15)
        Me.dlvPingResult.Name = "dlvPingResult"
        Me.dlvPingResult.Size = New System.Drawing.Size(385, 295)
        Me.dlvPingResult.TabIndex = 15
        Me.dlvPingResult.UseCompatibleStateImageBehavior = False
        Me.dlvPingResult.View = System.Windows.Forms.View.Details
        '
        'chkReverseLookup
        '
        Me.chkReverseLookup.AutoSize = True
        Me.chkReverseLookup.Checked = True
        Me.chkReverseLookup.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkReverseLookup.Location = New System.Drawing.Point(16, 273)
        Me.chkReverseLookup.Name = "chkReverseLookup"
        Me.chkReverseLookup.Size = New System.Drawing.Size(102, 17)
        Me.chkReverseLookup.TabIndex = 14
        Me.chkReverseLookup.Text = "ReverseLookup"
        Me.chkReverseLookup.UseVisualStyleBackColor = True
        '
        'chkReplies
        '
        Me.chkReplies.Checked = True
        Me.chkReplies.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkReplies.Location = New System.Drawing.Point(16, 243)
        Me.chkReplies.Name = "chkReplies"
        Me.chkReplies.Size = New System.Drawing.Size(104, 32)
        Me.chkReplies.TabIndex = 8
        Me.chkReplies.Text = "Display Replies "
        '
        'grpParameters
        '
        Me.grpParameters.Controls.Add(Me.txtPingDelay)
        Me.grpParameters.Controls.Add(Me.Label1)
        Me.grpParameters.Controls.Add(Me.lstFrameSize)
        Me.grpParameters.Controls.Add(Me.txtTTL)
        Me.grpParameters.Controls.Add(Me.lblTTL)
        Me.grpParameters.Controls.Add(Me.lblFrameSize)
        Me.grpParameters.Controls.Add(Me.txtTimeout)
        Me.grpParameters.Controls.Add(Me.lblTimeout)
        Me.grpParameters.Controls.Add(Me.txtPingLimit)
        Me.grpParameters.Controls.Add(Me.lblPingLimit)
        Me.grpParameters.Location = New System.Drawing.Point(16, 8)
        Me.grpParameters.Name = "grpParameters"
        Me.grpParameters.Size = New System.Drawing.Size(224, 226)
        Me.grpParameters.TabIndex = 5
        Me.grpParameters.TabStop = False
        Me.grpParameters.Text = "Ping Parameters"
        '
        'txtPingDelay
        '
        Me.txtPingDelay.Location = New System.Drawing.Point(176, 127)
        Me.txtPingDelay.Name = "txtPingDelay"
        Me.txtPingDelay.Size = New System.Drawing.Size(40, 20)
        Me.txtPingDelay.TabIndex = 13
        Me.txtPingDelay.Text = "2000"
        Me.txtPingDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label1
        '
        Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Label1.Location = New System.Drawing.Point(8, 127)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(136, 24)
        Me.Label1.TabIndex = 12
        Me.Label1.Text = "Ping Delay (milliseconds)"
        '
        'lstFrameSize
        '
        Me.lstFrameSize.FormattingEnabled = True
        Me.lstFrameSize.Items.AddRange(New Object() {"32", "64", "128", "256", "512", "1024", "2048", "4096"})
        Me.lstFrameSize.Location = New System.Drawing.Point(152, 151)
        Me.lstFrameSize.Name = "lstFrameSize"
        Me.lstFrameSize.Size = New System.Drawing.Size(64, 69)
        Me.lstFrameSize.TabIndex = 11
        '
        'txtTTL
        '
        Me.txtTTL.Location = New System.Drawing.Point(176, 103)
        Me.txtTTL.Name = "txtTTL"
        Me.txtTTL.Size = New System.Drawing.Size(40, 20)
        Me.txtTTL.TabIndex = 10
        Me.txtTTL.Text = "32"
        Me.txtTTL.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'lblTTL
        '
        Me.lblTTL.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblTTL.Location = New System.Drawing.Point(8, 103)
        Me.lblTTL.Name = "lblTTL"
        Me.lblTTL.Size = New System.Drawing.Size(136, 24)
        Me.lblTTL.TabIndex = 9
        Me.lblTTL.Text = "TimeToLive (TTL)"
        '
        'lblFrameSize
        '
        Me.lblFrameSize.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblFrameSize.Location = New System.Drawing.Point(8, 151)
        Me.lblFrameSize.Name = "lblFrameSize"
        Me.lblFrameSize.Size = New System.Drawing.Size(136, 24)
        Me.lblFrameSize.TabIndex = 7
        Me.lblFrameSize.Text = "Frame Size (Bytes)"
        '
        'txtTimeout
        '
        Me.txtTimeout.Location = New System.Drawing.Point(176, 79)
        Me.txtTimeout.Name = "txtTimeout"
        Me.txtTimeout.Size = New System.Drawing.Size(40, 20)
        Me.txtTimeout.TabIndex = 5
        Me.txtTimeout.Text = "500"
        Me.txtTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'lblTimeout
        '
        Me.lblTimeout.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblTimeout.Location = New System.Drawing.Point(8, 79)
        Me.lblTimeout.Name = "lblTimeout"
        Me.lblTimeout.Size = New System.Drawing.Size(136, 24)
        Me.lblTimeout.TabIndex = 4
        Me.lblTimeout.Text = "Timeout (milliseconds)"
        '
        'txtPingLimit
        '
        Me.txtPingLimit.Location = New System.Drawing.Point(176, 55)
        Me.txtPingLimit.Name = "txtPingLimit"
        Me.txtPingLimit.Size = New System.Drawing.Size(40, 20)
        Me.txtPingLimit.TabIndex = 3
        Me.txtPingLimit.Text = "5"
        Me.txtPingLimit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'lblPingLimit
        '
        Me.lblPingLimit.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblPingLimit.Location = New System.Drawing.Point(8, 55)
        Me.lblPingLimit.Name = "lblPingLimit"
        Me.lblPingLimit.Size = New System.Drawing.Size(136, 24)
        Me.lblPingLimit.TabIndex = 2
        Me.lblPingLimit.Text = "Ping Count Limit"
        '
        'lblOutstanding
        '
        Me.lblOutstanding.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblOutstanding.Location = New System.Drawing.Point(249, 332)
        Me.lblOutstanding.Name = "lblOutstanding"
        Me.lblOutstanding.Size = New System.Drawing.Size(32, 24)
        Me.lblOutstanding.TabIndex = 4
        Me.lblOutstanding.Text = "0"
        Me.lblOutstanding.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'lblPingOutstanding
        '
        Me.lblPingOutstanding.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblPingOutstanding.Location = New System.Drawing.Point(145, 332)
        Me.lblPingOutstanding.Name = "lblPingOutstanding"
        Me.lblPingOutstanding.Size = New System.Drawing.Size(104, 24)
        Me.lblPingOutstanding.TabIndex = 3
        Me.lblPingOutstanding.Text = "Pings Outstanding"
        '
        'lblSubmitted
        '
        Me.lblSubmitted.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblSubmitted.Location = New System.Drawing.Point(113, 332)
        Me.lblSubmitted.Name = "lblSubmitted"
        Me.lblSubmitted.Size = New System.Drawing.Size(32, 24)
        Me.lblSubmitted.TabIndex = 2
        Me.lblSubmitted.Text = "0"
        Me.lblSubmitted.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'lblPingSubmitted
        '
        Me.lblPingSubmitted.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblPingSubmitted.Location = New System.Drawing.Point(17, 332)
        Me.lblPingSubmitted.Name = "lblPingSubmitted"
        Me.lblPingSubmitted.Size = New System.Drawing.Size(96, 24)
        Me.lblPingSubmitted.TabIndex = 1
        Me.lblPingSubmitted.Text = "Pings Submitted"
        '
        'tbSteppedPing
        '
        Me.tbSteppedPing.Controls.Add(Me.grpChart)
        Me.tbSteppedPing.Controls.Add(Me.axchartSteppedPing)
        Me.tbSteppedPing.Controls.Add(Me.Label2)
        Me.tbSteppedPing.Controls.Add(Me.dlvSteppedPing)
        Me.tbSteppedPing.Controls.Add(Me.grpReports)
        Me.tbSteppedPing.Controls.Add(Me.txtStepPingCt)
        Me.tbSteppedPing.Controls.Add(Me.lblSPingSize)
        Me.tbSteppedPing.Controls.Add(Me.chkSteppedPingEnabled)
        Me.tbSteppedPing.Controls.Add(Me.lblTextPingCaveat)
        Me.tbSteppedPing.Controls.Add(Me.txtStepPingSize)
        Me.tbSteppedPing.Location = New System.Drawing.Point(4, 22)
        Me.tbSteppedPing.Name = "tbSteppedPing"
        Me.tbSteppedPing.Size = New System.Drawing.Size(676, 394)
        Me.tbSteppedPing.TabIndex = 3
        Me.tbSteppedPing.Text = "Stepped Ping"
        Me.tbSteppedPing.UseVisualStyleBackColor = True
        '
        'grpChart
        '
        Me.grpChart.Controls.Add(Me.cmdCopySpChart)
        Me.grpChart.Controls.Add(Me.checkBoxShowChartArea2)
        Me.grpChart.Controls.Add(Me.checkBoxShowChartArea1)
        Me.grpChart.Controls.Add(Me.AlignmentCombo)
        Me.grpChart.Controls.Add(Me.label12)
        Me.grpChart.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.grpChart.Location = New System.Drawing.Point(311, 163)
        Me.grpChart.Name = "grpChart"
        Me.grpChart.Size = New System.Drawing.Size(155, 208)
        Me.grpChart.TabIndex = 15
        Me.grpChart.TabStop = False
        Me.grpChart.Text = "Chart Options"
        '
        'cmdCopySpChart
        '
        Me.cmdCopySpChart.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdCopySpChart.Location = New System.Drawing.Point(11, 144)
        Me.cmdCopySpChart.Name = "cmdCopySpChart"
        Me.cmdCopySpChart.Size = New System.Drawing.Size(83, 32)
        Me.cmdCopySpChart.TabIndex = 15
        Me.cmdCopySpChart.Text = "copyChart"
        '
        'checkBoxShowChartArea2
        '
        Me.checkBoxShowChartArea2.Checked = True
        Me.checkBoxShowChartArea2.CheckState = System.Windows.Forms.CheckState.Checked
        Me.checkBoxShowChartArea2.Enabled = False
        Me.checkBoxShowChartArea2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.checkBoxShowChartArea2.Location = New System.Drawing.Point(7, 65)
        Me.checkBoxShowChartArea2.Name = "checkBoxShowChartArea2"
        Me.checkBoxShowChartArea2.RightToLeft = System.Windows.Forms.RightToLeft.Yes
        Me.checkBoxShowChartArea2.Size = New System.Drawing.Size(140, 24)
        Me.checkBoxShowChartArea2.TabIndex = 14
        Me.checkBoxShowChartArea2.Text = "ErrorCounts"
        '
        'checkBoxShowChartArea1
        '
        Me.checkBoxShowChartArea1.Checked = True
        Me.checkBoxShowChartArea1.CheckState = System.Windows.Forms.CheckState.Checked
        Me.checkBoxShowChartArea1.Enabled = False
        Me.checkBoxShowChartArea1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.checkBoxShowChartArea1.Location = New System.Drawing.Point(7, 33)
        Me.checkBoxShowChartArea1.Name = "checkBoxShowChartArea1"
        Me.checkBoxShowChartArea1.RightToLeft = System.Windows.Forms.RightToLeft.Yes
        Me.checkBoxShowChartArea1.Size = New System.Drawing.Size(140, 24)
        Me.checkBoxShowChartArea1.TabIndex = 13
        Me.checkBoxShowChartArea1.Text = "ResponseTime"
        '
        'AlignmentCombo
        '
        Me.AlignmentCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.AlignmentCombo.Enabled = False
        Me.AlignmentCombo.Items.AddRange(New Object() {"Horizontally", "Vertically"})
        Me.AlignmentCombo.Location = New System.Drawing.Point(11, 117)
        Me.AlignmentCombo.Name = "AlignmentCombo"
        Me.AlignmentCombo.Size = New System.Drawing.Size(136, 24)
        Me.AlignmentCombo.TabIndex = 12
        '
        'label12
        '
        Me.label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.label12.Location = New System.Drawing.Point(8, 91)
        Me.label12.Name = "label12"
        Me.label12.Size = New System.Drawing.Size(44, 23)
        Me.label12.TabIndex = 11
        Me.label12.Text = "&Align:"
        Me.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'axchartSteppedPing
        '
        Me.axchartSteppedPing.BackColor = System.Drawing.Color.FromArgb(CType(CType(211, Byte), Integer), CType(CType(223, Byte), Integer), CType(CType(240, Byte), Integer))
        Me.axchartSteppedPing.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom
        Me.axchartSteppedPing.BackSecondaryColor = System.Drawing.Color.White
        Me.axchartSteppedPing.BorderlineColor = System.Drawing.Color.FromArgb(CType(CType(26, Byte), Integer), CType(CType(59, Byte), Integer), CType(CType(105, Byte), Integer))
        Me.axchartSteppedPing.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid
        Me.axchartSteppedPing.BorderlineWidth = 2
        Me.axchartSteppedPing.BorderSkin.SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss
        ChartArea1.Area3DStyle.Inclination = 15
        ChartArea1.Area3DStyle.IsClustered = True
        ChartArea1.Area3DStyle.IsRightAngleAxes = False
        ChartArea1.Area3DStyle.Perspective = 10
        ChartArea1.Area3DStyle.Rotation = 10
        ChartArea1.Area3DStyle.WallWidth = 0
        ChartArea1.AxisX.LabelAutoFitStyle = CType(((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.DecreaseFont Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) _
                    Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap), System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)
        ChartArea1.AxisX.LabelStyle.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Bold)
        ChartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea1.AxisX.Title = "FrameSize"
        ChartArea1.AxisY.LabelAutoFitStyle = CType(((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) _
                    Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap), System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)
        ChartArea1.AxisY.LabelStyle.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Bold)
        ChartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea1.AxisY.LineWidth = 2
        ChartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea1.AxisY.Title = "RespTime (Ms)"
        ChartArea1.AxisY2.Title = "ErrorCt"
        ChartArea1.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(165, Byte), Integer), CType(CType(191, Byte), Integer), CType(CType(228, Byte), Integer))
        ChartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom
        ChartArea1.BackSecondaryColor = System.Drawing.Color.White
        ChartArea1.BorderColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea1.Name = "Default"
        ChartArea1.ShadowColor = System.Drawing.Color.Transparent
        ChartArea2.AlignWithChartArea = "Default"
        ChartArea2.Area3DStyle.Inclination = 15
        ChartArea2.Area3DStyle.IsClustered = True
        ChartArea2.Area3DStyle.IsRightAngleAxes = False
        ChartArea2.Area3DStyle.Perspective = 10
        ChartArea2.Area3DStyle.Rotation = 10
        ChartArea2.Area3DStyle.WallWidth = 0
        ChartArea2.AxisX.LabelAutoFitStyle = CType(((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.DecreaseFont Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) _
                    Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap), System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)
        ChartArea2.AxisX.LabelStyle.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Bold)
        ChartArea2.AxisX.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea2.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea2.AxisX.Title = "FrameSize"
        ChartArea2.AxisY.LabelAutoFitStyle = CType(((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) _
                    Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap), System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)
        ChartArea2.AxisY.LabelStyle.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Bold)
        ChartArea2.AxisY.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea2.AxisY.LineWidth = 2
        ChartArea2.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea2.AxisY2.LabelAutoFitStyle = CType(((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) _
                    Or System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap), System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)
        ChartArea2.AxisY2.LabelStyle.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Bold)
        ChartArea2.AxisY2.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea2.AxisY2.MajorGrid.LineColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea2.AxisY2.Title = "ErrorCt"
        ChartArea2.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(165, Byte), Integer), CType(CType(191, Byte), Integer), CType(CType(228, Byte), Integer))
        ChartArea2.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom
        ChartArea2.BackSecondaryColor = System.Drawing.Color.White
        ChartArea2.BorderColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
        ChartArea2.Name = "Errors"
        ChartArea2.ShadowColor = System.Drawing.Color.Transparent
        ChartArea2.Visible = False
        Me.axchartSteppedPing.ChartAreas.Add(ChartArea1)
        Me.axchartSteppedPing.ChartAreas.Add(ChartArea2)
        Legend1.BackColor = System.Drawing.Color.Transparent
        Legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Bottom
        Legend1.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Bold)
        Legend1.IsTextAutoFit = False
        Legend1.MaximumAutoSize = 25.0!
        Legend1.Name = "Default"
        Me.axchartSteppedPing.Legends.Add(Legend1)
        Me.axchartSteppedPing.Location = New System.Drawing.Point(13, 165)
        Me.axchartSteppedPing.Name = "axchartSteppedPing"
        Series1.BorderColor = System.Drawing.Color.FromArgb(CType(CType(180, Byte), Integer), CType(CType(26, Byte), Integer), CType(CType(59, Byte), Integer), CType(CType(105, Byte), Integer))
        Series1.ChartArea = "Default"
        Series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line
        Series1.Color = System.Drawing.Color.Red
        Series1.Legend = "Default"
        Series1.Name = "spMax"
        Series1.Points.Add(DataPoint1)
        Series1.Points.Add(DataPoint2)
        Series1.Points.Add(DataPoint3)
        Series1.Points.Add(DataPoint4)
        Series1.Points.Add(DataPoint5)
        Series1.XValueMember = "spPacketSize"
        Series1.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.[String]
        Series1.YValueMembers = "spMaxDelay"
        Series1.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.[Double]
        Series2.BorderColor = System.Drawing.Color.FromArgb(CType(CType(180, Byte), Integer), CType(CType(26, Byte), Integer), CType(CType(59, Byte), Integer), CType(CType(105, Byte), Integer))
        Series2.BorderWidth = 2
        Series2.ChartArea = "Default"
        Series2.Legend = "Default"
        Series2.Name = "spErrorCt"
        Series2.Points.Add(DataPoint6)
        Series2.Points.Add(DataPoint7)
        Series2.Points.Add(DataPoint8)
        Series2.Points.Add(DataPoint9)
        Series2.Points.Add(DataPoint10)
        Series2.ShadowOffset = 1
        Series2.XValueMember = "spPacketSize"
        Series2.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.[String]
        Series2.YAxisType = System.Windows.Forms.DataVisualization.Charting.AxisType.Secondary
        Series2.YValueMembers = "spErrorCt"
        Series2.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32
        Series3.ChartArea = "Default"
        Series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line
        Series3.Color = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(128, Byte), Integer), CType(CType(0, Byte), Integer))
        Series3.Legend = "Default"
        Series3.Name = "spAvg"
        Series3.XValueMember = "spPacketSize"
        Series3.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.[String]
        Series3.YValueMembers = "spAvgDelay"
        Series3.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.[Double]
        Series4.ChartArea = "Default"
        Series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line
        Series4.Color = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
        Series4.Legend = "Default"
        Series4.Name = "spMin"
        Series4.XValueMember = "spPacketSize"
        Series4.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.[String]
        Series4.YValueMembers = "spMinDelay"
        Series4.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.[Double]
        Me.axchartSteppedPing.Series.Add(Series1)
        Me.axchartSteppedPing.Series.Add(Series2)
        Me.axchartSteppedPing.Series.Add(Series3)
        Me.axchartSteppedPing.Series.Add(Series4)
        Me.axchartSteppedPing.Size = New System.Drawing.Size(284, 207)
        Me.axchartSteppedPing.TabIndex = 14
        Title1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Title1.Name = "SteppedPing "
        Title1.Text = "Stepped Ping"
        Title1.Visible = False
        Title2.Name = "TargetIp"
        Title2.Text = "Unknown"
        Title2.Visible = False
        Me.axchartSteppedPing.Titles.Add(Title1)
        Me.axchartSteppedPing.Titles.Add(Title2)
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(512, 162)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(77, 20)
        Me.Label2.TabIndex = 11
        Me.Label2.Text = "Iteration"
        '
        'dlvSteppedPing
        '
        Me.dlvSteppedPing.Location = New System.Drawing.Point(13, 14)
        Me.dlvSteppedPing.Name = "dlvSteppedPing"
        Me.dlvSteppedPing.Size = New System.Drawing.Size(284, 140)
        Me.dlvSteppedPing.TabIndex = 10
        Me.dlvSteppedPing.UseCompatibleStateImageBehavior = False
        Me.dlvSteppedPing.View = System.Windows.Forms.View.Details
        '
        'grpReports
        '
        Me.grpReports.Controls.Add(Me.cmdBuildSpReport)
        Me.grpReports.Controls.Add(Me.optChart)
        Me.grpReports.Controls.Add(Me.optTable)
        Me.grpReports.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.grpReports.Location = New System.Drawing.Point(303, 14)
        Me.grpReports.Name = "grpReports"
        Me.grpReports.Size = New System.Drawing.Size(164, 115)
        Me.grpReports.TabIndex = 9
        Me.grpReports.TabStop = False
        Me.grpReports.Text = "Reports"
        '
        'cmdBuildSpReport
        '
        Me.cmdBuildSpReport.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdBuildSpReport.Location = New System.Drawing.Point(7, 70)
        Me.cmdBuildSpReport.Name = "cmdBuildSpReport"
        Me.cmdBuildSpReport.Size = New System.Drawing.Size(86, 32)
        Me.cmdBuildSpReport.TabIndex = 8
        Me.cmdBuildSpReport.Text = "buildReport"
        '
        'optChart
        '
        Me.optChart.AutoSize = True
        Me.optChart.Checked = True
        Me.optChart.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.optChart.Location = New System.Drawing.Point(7, 44)
        Me.optChart.Name = "optChart"
        Me.optChart.Size = New System.Drawing.Size(57, 20)
        Me.optChart.TabIndex = 1
        Me.optChart.TabStop = True
        Me.optChart.Text = "Chart"
        Me.optChart.UseVisualStyleBackColor = True
        '
        'optTable
        '
        Me.optTable.AutoSize = True
        Me.optTable.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.optTable.Location = New System.Drawing.Point(7, 20)
        Me.optTable.Name = "optTable"
        Me.optTable.Size = New System.Drawing.Size(62, 20)
        Me.optTable.TabIndex = 0
        Me.optTable.Text = "Table"
        Me.optTable.UseVisualStyleBackColor = True
        '
        'txtStepPingCt
        '
        Me.txtStepPingCt.Location = New System.Drawing.Point(600, 160)
        Me.txtStepPingCt.Name = "txtStepPingCt"
        Me.txtStepPingCt.Size = New System.Drawing.Size(48, 20)
        Me.txtStepPingCt.TabIndex = 6
        '
        'lblSPingSize
        '
        Me.lblSPingSize.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSPingSize.Location = New System.Drawing.Point(512, 134)
        Me.lblSPingSize.Name = "lblSPingSize"
        Me.lblSPingSize.Size = New System.Drawing.Size(77, 20)
        Me.lblSPingSize.TabIndex = 5
        Me.lblSPingSize.Text = "Pkt Size"
        '
        'chkSteppedPingEnabled
        '
        Me.chkSteppedPingEnabled.Checked = True
        Me.chkSteppedPingEnabled.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkSteppedPingEnabled.Location = New System.Drawing.Point(506, 186)
        Me.chkSteppedPingEnabled.Name = "chkSteppedPingEnabled"
        Me.chkSteppedPingEnabled.Size = New System.Drawing.Size(144, 24)
        Me.chkSteppedPingEnabled.TabIndex = 4
        Me.chkSteppedPingEnabled.Text = "Stepped Ping Enabled"
        '
        'lblTextPingCaveat
        '
        Me.lblTextPingCaveat.Location = New System.Drawing.Point(512, 14)
        Me.lblTextPingCaveat.Name = "lblTextPingCaveat"
        Me.lblTextPingCaveat.Size = New System.Drawing.Size(136, 111)
        Me.lblTextPingCaveat.TabIndex = 3
        Me.lblTextPingCaveat.Text = resources.GetString("lblTextPingCaveat.Text")
        '
        'txtStepPingSize
        '
        Me.txtStepPingSize.Location = New System.Drawing.Point(600, 131)
        Me.txtStepPingSize.Name = "txtStepPingSize"
        Me.txtStepPingSize.Size = New System.Drawing.Size(48, 20)
        Me.txtStepPingSize.TabIndex = 2
        '
        'tbTraceRt
        '
        Me.tbTraceRt.Controls.Add(Me.cmdTRReport)
        Me.tbTraceRt.Controls.Add(Me.dlvTraceRoute)
        Me.tbTraceRt.Controls.Add(Me.GroupBox1)
        Me.tbTraceRt.Controls.Add(Me.lblAutoSteppedPing)
        Me.tbTraceRt.Controls.Add(Me.chkDrawTrace)
        Me.tbTraceRt.Location = New System.Drawing.Point(4, 22)
        Me.tbTraceRt.Name = "tbTraceRt"
        Me.tbTraceRt.Size = New System.Drawing.Size(676, 394)
        Me.tbTraceRt.TabIndex = 2
        Me.tbTraceRt.Text = "Trace Route"
        Me.tbTraceRt.UseVisualStyleBackColor = True
        '
        'cmdTRReport
        '
        Me.cmdTRReport.Location = New System.Drawing.Point(600, 349)
        Me.cmdTRReport.Name = "cmdTRReport"
        Me.cmdTRReport.Size = New System.Drawing.Size(64, 32)
        Me.cmdTRReport.TabIndex = 18
        Me.cmdTRReport.Text = "TRReport"
        '
        'dlvTraceRoute
        '
        Me.dlvTraceRoute.Location = New System.Drawing.Point(198, 21)
        Me.dlvTraceRoute.Name = "dlvTraceRoute"
        Me.dlvTraceRoute.Size = New System.Drawing.Size(466, 322)
        Me.dlvTraceRoute.TabIndex = 17
        Me.dlvTraceRoute.UseCompatibleStateImageBehavior = False
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.lblCurrTime)
        Me.GroupBox1.Controls.Add(Me.lblCurrStep)
        Me.GroupBox1.Controls.Add(Me.lblTraceRt_IPAddress)
        Me.GroupBox1.Controls.Add(Me.lblTraceRt_Name)
        Me.GroupBox1.Location = New System.Drawing.Point(8, 56)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(160, 125)
        Me.GroupBox1.TabIndex = 13
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "Trace Route Data"
        '
        'lblCurrTime
        '
        Me.lblCurrTime.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblCurrTime.Location = New System.Drawing.Point(112, 89)
        Me.lblCurrTime.Name = "lblCurrTime"
        Me.lblCurrTime.Size = New System.Drawing.Size(40, 24)
        Me.lblCurrTime.TabIndex = 15
        '
        'lblCurrStep
        '
        Me.lblCurrStep.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblCurrStep.Location = New System.Drawing.Point(8, 89)
        Me.lblCurrStep.Name = "lblCurrStep"
        Me.lblCurrStep.Size = New System.Drawing.Size(100, 23)
        Me.lblCurrStep.TabIndex = 14
        '
        'lblTraceRt_IPAddress
        '
        Me.lblTraceRt_IPAddress.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblTraceRt_IPAddress.Location = New System.Drawing.Point(8, 56)
        Me.lblTraceRt_IPAddress.Name = "lblTraceRt_IPAddress"
        Me.lblTraceRt_IPAddress.Size = New System.Drawing.Size(144, 24)
        Me.lblTraceRt_IPAddress.TabIndex = 13
        '
        'lblTraceRt_Name
        '
        Me.lblTraceRt_Name.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.lblTraceRt_Name.Location = New System.Drawing.Point(8, 24)
        Me.lblTraceRt_Name.Name = "lblTraceRt_Name"
        Me.lblTraceRt_Name.Size = New System.Drawing.Size(144, 24)
        Me.lblTraceRt_Name.TabIndex = 12
        '
        'lblAutoSteppedPing
        '
        Me.lblAutoSteppedPing.Location = New System.Drawing.Point(13, 288)
        Me.lblAutoSteppedPing.Name = "lblAutoSteppedPing"
        Me.lblAutoSteppedPing.Size = New System.Drawing.Size(147, 79)
        Me.lblAutoSteppedPing.TabIndex = 4
        Me.lblAutoSteppedPing.Text = "Note: Selecting a resource after the trace route completes will automatically per" & _
            "form a Stepped Ping Analysis"
        '
        'chkDrawTrace
        '
        Me.chkDrawTrace.Checked = True
        Me.chkDrawTrace.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkDrawTrace.Location = New System.Drawing.Point(16, 199)
        Me.chkDrawTrace.Name = "chkDrawTrace"
        Me.chkDrawTrace.Size = New System.Drawing.Size(128, 24)
        Me.chkDrawTrace.TabIndex = 2
        Me.chkDrawTrace.Text = "Draw Trace (Visio)"
        '
        'tbVisio
        '
        Me.tbVisio.Controls.Add(Me.axdrawTraceDisplay)
        Me.tbVisio.Controls.Add(Me.cmdCopyVisio)
        Me.tbVisio.Controls.Add(Me.cmdPanZoom)
        Me.tbVisio.Location = New System.Drawing.Point(4, 22)
        Me.tbVisio.Name = "tbVisio"
        Me.tbVisio.Padding = New System.Windows.Forms.Padding(3)
        Me.tbVisio.Size = New System.Drawing.Size(676, 394)
        Me.tbVisio.TabIndex = 4
        Me.tbVisio.Text = "Trace Display"
        Me.tbVisio.UseVisualStyleBackColor = True
        '
        'axdrawTraceDisplay
        '
        Me.axdrawTraceDisplay.Enabled = True
        Me.axdrawTraceDisplay.Location = New System.Drawing.Point(6, 6)
        Me.axdrawTraceDisplay.Name = "axdrawTraceDisplay"
        Me.axdrawTraceDisplay.OcxState = CType(resources.GetObject("axdrawTraceDisplay.OcxState"), System.Windows.Forms.AxHost.State)
        Me.axdrawTraceDisplay.Size = New System.Drawing.Size(655, 337)
        Me.axdrawTraceDisplay.TabIndex = 4
        '
        'cmdCopyVisio
        '
        Me.cmdCopyVisio.Location = New System.Drawing.Point(521, 349)
        Me.cmdCopyVisio.Name = "cmdCopyVisio"
        Me.cmdCopyVisio.Size = New System.Drawing.Size(61, 32)
        Me.cmdCopyVisio.TabIndex = 3
        Me.cmdCopyVisio.Text = "Copy"
        Me.cmdCopyVisio.UseVisualStyleBackColor = True
        '
        'cmdPanZoom
        '
        Me.cmdPanZoom.Location = New System.Drawing.Point(600, 349)
        Me.cmdPanZoom.Name = "cmdPanZoom"
        Me.cmdPanZoom.Size = New System.Drawing.Size(61, 32)
        Me.cmdPanZoom.TabIndex = 1
        Me.cmdPanZoom.Text = "PanZoom"
        Me.cmdPanZoom.UseVisualStyleBackColor = True
        '
        'cmdClose
        '
        Me.cmdClose.Location = New System.Drawing.Point(624, 434)
        Me.cmdClose.Name = "cmdClose"
        Me.cmdClose.Size = New System.Drawing.Size(64, 32)
        Me.cmdClose.TabIndex = 3
        Me.cmdClose.Text = "Close"
        '
        'Timer2
        '
        '
        'frmICMPMgmt
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(725, 489)
        Me.Controls.Add(Me.cmdClose)
        Me.Controls.Add(Me.TabControl1)
        Me.Name = "frmICMPMgmt"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Network Connectivity"
        Me.TabControl1.ResumeLayout(False)
        Me.tbNetStatus.ResumeLayout(False)
        Me.tbNetStatus.PerformLayout()
        Me.tbPingConf.ResumeLayout(False)
        Me.tbPingConf.PerformLayout()
        Me.StatusStrip1.ResumeLayout(False)
        Me.StatusStrip1.PerformLayout()
        Me.grpParameters.ResumeLayout(False)
        Me.grpParameters.PerformLayout()
        Me.tbSteppedPing.ResumeLayout(False)
        Me.tbSteppedPing.PerformLayout()
        Me.grpChart.ResumeLayout(False)
        CType(Me.axchartSteppedPing, System.ComponentModel.ISupportInitialize).EndInit()
        Me.grpReports.ResumeLayout(False)
        Me.grpReports.PerformLayout()
        Me.tbTraceRt.ResumeLayout(False)
        Me.GroupBox1.ResumeLayout(False)
        Me.tbVisio.ResumeLayout(False)
        CType(Me.axdrawTraceDisplay, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

#Region " properties and declarations "


    Private m_clsvisio As visRackSysMgmt.clsVisioSupport


    Private clsPing As clsV2Ping

    Private clsPingResult As IcmpPingResults
    Private clsStepPingResult As IcmpStepPingResult
    Private clsTraceResult As IcmpTraceRouteResult
    Private clsPingDevice As ICMPPingDevice

    ' for working with live network shapes
    Private clsComponents As clsComponents
    Private clsNetwork As visRackSysMgmt.clsAttrNetwork


    Private pingsSubmitted As Int32 = 0
    Private strLastAutomatedTarget As String = ""
    Private blnTimerFired As Boolean
    Private Const APPNAME As String = "Network Connectivity Test"
    Private aPacketSizes As Object() = New Object() {"16", "32", "64", "128", "256", "512", "1K", "2K", "4K"}

    Friend WithEvents txtStepPingCt As System.Windows.Forms.TextBox



    '********* visio snippet vb.net vis0042vb ******************
    Private _drawingControl As AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
    Public Property drawingControl() As AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
        Get
            Return Me._drawingControl
        End Get
        Set(ByVal value As AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl)
            Me._drawingControl = value
        End Set
    End Property

    '********* visio snippet vb.net vis0041vb ******************
    Private _drawingApplication As Microsoft.Office.Interop.Visio.Application
    Public Property drawingApplication() As Microsoft.Office.Interop.Visio.Application
        Get
            Return Me._drawingApplication
        End Get
        Set(ByVal value As Microsoft.Office.Interop.Visio.Application)
            If (value Is Nothing) Then
                Throw New System.ArgumentNullException("Value", _
                    "drawingApplication is Null.")
            End If
            Me._drawingApplication = value
        End Set
    End Property

    '********* visio snippet vb.net vis0043vb ******************
    Private _drawingDocument As Microsoft.Office.Interop.Visio.Document
    Public Property drawingDocument() As Microsoft.Office.Interop.Visio.Document
        Get
            Return Me._drawingDocument
        End Get
        Set(ByVal value As Microsoft.Office.Interop.Visio.Document)
            If (value Is Nothing) Then
                Throw New System.ArgumentNullException("Value", _
                    "drawingDocument is Null.")
            End If
            Me._drawingDocument = value
        End Set
    End Property


    '********* visio snippet vb.net vis0045vb ******************
    Private _drawingWindow As Microsoft.Office.Interop.Visio.Window
    Public Property drawingWindow() As Microsoft.Office.Interop.Visio.Window
        Get
            Return Me._drawingWindow
        End Get
        Set(ByVal value As Microsoft.Office.Interop.Visio.Window)
            If (value Is Nothing) Then
                Throw New System.ArgumentNullException("Value", _
                    "drawingWindow is Null.")
            End If
            Me._drawingWindow = value
        End Set
    End Property

    '********* visio snippet vb.net vis0044vb ******************
    Private _drawingPage As Microsoft.Office.Interop.Visio.Page
    Public Property drawingPage() As Microsoft.Office.Interop.Visio.Page
        Get
            Return Me._drawingPage
        End Get
        Set(ByVal value As Microsoft.Office.Interop.Visio.Page)
            If (value Is Nothing) Then
                Throw New System.ArgumentNullException("Value", _
                    "drawingPage is Null.")
            End If
            Me._drawingPage = value
        End Set
    End Property



    Private m_selectedIP As String
    Public Property selectedIP As String
        Get
            Return m_selectedIP
        End Get
        Set(ByVal value As String)
            m_selectedIP = value
            txtIPTarget.Text = selectedIP
        End Set
    End Property



    Private lngState As Int32

    ' array for stepped ping constants
    ' includes the packet size and multipler for
    ' building the send string

    Private Structure stcStepPingConst
        Public intPacketSize As Integer
        Public intPacketMult As Integer
    End Structure
    Private arrPingBuffSize(8) As stcStepPingConst

    Private Sub initStepPingConstants()
        arrPingBuffSize(0).intPacketSize = 16
        arrPingBuffSize(0).intPacketMult = 1
        arrPingBuffSize(1).intPacketSize = 32
        arrPingBuffSize(1).intPacketMult = 2
        arrPingBuffSize(2).intPacketSize = 64
        arrPingBuffSize(2).intPacketMult = 4
        arrPingBuffSize(3).intPacketSize = 128
        arrPingBuffSize(3).intPacketMult = 8
        arrPingBuffSize(4).intPacketSize = 256
        arrPingBuffSize(4).intPacketMult = 16
        arrPingBuffSize(5).intPacketSize = 512
        arrPingBuffSize(5).intPacketMult = 32
        arrPingBuffSize(6).intPacketSize = 1024
        arrPingBuffSize(6).intPacketMult = 64
        arrPingBuffSize(7).intPacketSize = 2048
        arrPingBuffSize(7).intPacketMult = 128
        arrPingBuffSize(8).intPacketSize = 4096
        arrPingBuffSize(8).intPacketMult = 256
    End Sub

    Public strPingBuffer As String = ""
    Private Sub buildPingBuffer(ByVal devFrameSize As Integer)
        Dim strByte As String = "0123456789abcdef"
        Dim strByteCount As Integer = Me.lstFrameSize.SelectedItem.ToString
        Dim intMult As Integer
        Dim intCtr As Integer
        strPingBuffer = ""
        Try
            For intCtr = 0 To 8
                If arrPingBuffSize(intCtr).intPacketSize = devFrameSize Then
                    intMult = arrPingBuffSize(intCtr).intPacketMult
                End If
            Next intCtr

            For intCtr = 1 To intMult
                strPingBuffer = strPingBuffer & strByte
            Next intCtr

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub


#End Region

#Region " Constructor "


    '
    ' since this form is driven by a visio drawing, we need the application and document
    ' after we initialize the local drawing control we update the locals with what was passed in
    '
    Public Sub New _
        (ByVal visApp As Microsoft.Office.Interop.Visio.Application, _
         ByVal visDoc As Microsoft.Office.Interop.Visio.Document)
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()
        'Add any initialization after the InitializeComponent() call

        m_clsvisio = New visRackSysMgmt.clsVisioSupport

        drawingControl = axdrawTraceDisplay
        InitTheDrawingControl()

        drawingApplication = visApp
        drawingDocument = visDoc
        drawingWindow = visApp.ActiveWindow



        ' move result data declarations and result processing to separate classes
        ' new class result format
        clsPingResult = New IcmpPingResults
        clsStepPingResult = New IcmpStepPingResult
        clsTraceResult = New IcmpTraceRouteResult

        clsPing = New clsV2Ping

        clsPingDevice = New ICMPPingDevice
        clsPingDevice.devAddress = selectedIP
        txtIPTarget.Text = selectedIP

        ' the network attibute class is loaded so that we can update the database
        ' as appropriate
        clsNetwork = New clsAttrNetwork(drawingApplication, drawingDocument)

        ' set the default packet size to 32 bytes
        Me.lstFrameSize.SetSelected(0, True)
        initStepPingConstants()


    End Sub


    '********* visio snippet vb.net vis0049vb ******************
    ' Properties and Definitions
    Private Const defaultICMPDocument As String = "ICMPDocument"
    Private Const defaultICMPPage As String = "ICMPPage"

    Private Sub InitTheDrawingControl()

        Try

            '
            ' get the pointers
            '
            ' make sure the control does not change the pagesizebehavior
            Me.drawingControl.PageSizingBehavior = VisPageSizingBehaviors.visNeverResizePages

            Me.drawingWindow = Me.drawingControl.Window
            Me.drawingWindow.Activate()
            Me.drawingApplication = Me.drawingControl.Window.Application

            Me.drawingDocument = Me.drawingControl.Document
            Dim docSheet As Shape = Me.drawingDocument.DocumentSheet
            docSheet.NameU = defaultICMPDocument
            Me.drawingDocument.DiagramServicesEnabled = VisDiagramServices.visServiceVersion140

            Me.drawingPage = Me.drawingControl.Window.Page
            Me.drawingPage.NameU = defaultICMPPage
            drawingWindow.Page = drawingPage

            Me.drawingApplication.Application.Settings.EnableAutoConnect = False
            Me.drawingApplication.OnDataChangeDelay = -2

            Me.drawingWindow.ShowGrid = False
            Me.drawingWindow.ShowPageTabs = True
            Me.drawingWindow.ShowRulers = False
            Me.drawingWindow.ShowScrollBars = True

            Dim visPageSheet As Microsoft.Office.Interop.Visio.Shape
            visPageSheet = drawingPage.PageSheet

            Dim visCell As Microsoft.Office.Interop.Visio.Cell
            visCell = visPageSheet.Cells("PageWidth")
            m_clsvisio.SetCellValueToString(visCell, "11")
            visCell = visPageSheet.Cells("PageHeight")
            m_clsvisio.SetCellValueToString(visCell, "8.5")


        Catch com As COMException
            ' add com exception handler here
            '********* visio snippet vb.net vis0056vb ******************
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(com, "Com+ Policy")
            If (rethrow) Then
                Throw
            End If

        Catch ex As Exception
            ' add exception handler here
            '********* visio snippet vb.net vis0059vb ******************
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If

        End Try

    End Sub

    '
    '
    '
    Private Sub loadNetworkShapesSelectedList()

        Dim strIpAddress As String = ""
        Dim strLastStatus As String = ""
        Dim objShape As Microsoft.Office.Interop.Visio.Shape
        Dim objCell As Microsoft.Office.Interop.Visio.Cell
        Dim itmX As ListViewItem


        dlvSelectedShapes.View = View.Details
        Me.dlvSelectedShapes.Items.Clear()

        Try


            If 0 < drawingWindow.Selection.Count Then
                'Debug.Print ActiveWindow.Selection.Count & " devices selected"
                For iObjCount = 1 To drawingWindow.Selection.Count
                    strIpAddress = ""
                    strLastStatus = ""
                    objShape = drawingWindow.Selection.Item(iObjCount)

                    If objShape.CellExists("prop.attrnetStatus", False) = True Then
                        strLastStatus = objShape.Cells("prop.attrnetStatus").ResultStr("")
                        If IsNumeric(strLastStatus) = True Then
                            strLastStatus = [Enum].GetName(GetType(dc_Network.netStatus), CInt(strLastStatus))
                        End If
                    End If

                    If objShape.CellExists("prop.attrnetIpAddress", False) = True Then
                        strIpAddress = objShape.Cells("prop.attrnetIpAddress").ResultStr("")

                        If objShape.CellExists("prop.comptype", False) = True Then

                            objCell = objShape.Cells("prop.comptype")
                            If objCell.FormulaU <> "20" Then
                                itmX = Nothing
                                itmX = New ListViewItem
                                itmX.Name = objShape.Name
                                itmX.Text = objShape.Name
                                itmX.SubItems.Add(strIpAddress)
                                itmX.SubItems.Add(strLastStatus)

                                dlvSelectedShapes.Items.Add(itmX)

                                If strIpAddress = "" Then
                                    itmX.Checked = False
                                Else
                                    itmX.Checked = True
                                End If ' test for blank address
                            End If ' test for passive

                        End If ' test for vnettype

                    End If ' test for ipaddress


                    If iObjCount = 1 Then
                        Me.txtIPTarget.Text = strIpAddress
                    End If


                Next iObjCount
            End If

        Catch com As COMException
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(com, "Com+ Policy")
            If (rethrow) Then
                Throw
            End If
        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try


    End Sub



#End Region

#Region " network friendly delay "


    ' 
    ' make sure we do not flood the network with pings....
    ' we do not want a false denial-of-service attack detected because
    ' of sloppy thinking
    '
    Private Sub NetFriendlyDelay(ByVal intTime As Integer)
        ' delay the tests so we
        ' don't flood the network
        InitTimer2(intTime)
        While blnTimerFired = False
            ' gotta make sure the events can fire
            System.Windows.Forms.Application.DoEvents()
        End While
        StopTimer2()
    End Sub


    Private Sub InitTimer2(ByVal intTime As Integer)
        blnTimerFired = False
        Timer2.Interval = intTime
        Timer2.Enabled = True
    End Sub

    Private Sub StopTimer2()
        Timer2.Enabled = False
        blnTimerFired = False
    End Sub

    Private Sub Timer2_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        blnTimerFired = True
    End Sub

    '
    ' how int32 do we want to wait for a response to the ping
    '
    Private Function changeTimeout() As Boolean

        clsPing.PingTimeout = 0
        If (txtTimeout.Text = "0") Then Return True

        Dim timeout As Integer
        Try
            timeout = Convert.ToInt32(txtTimeout.Text)
        Catch
            MessageBox.Show("The timeout has been set to an invalid value", APPNAME, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
            txtTimeout.Focus()
            Return False
        End Try

        If ((timeout < 0) Or (timeout > 99999)) Then
            MessageBox.Show("Timeout must be between 0 and 99999", APPNAME, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
            txtTimeout.Focus()
            Return False
        End If

        clsPing.PingTimeout = timeout
        Return True

    End Function

#End Region

#Region " Ping Methods "

    '
    ' pass in the target using the devAddress property
    '
    Private Sub DoPingSync _
            (ByVal pingDevice As ICMPPingDevice, _
            ByVal intRsp As Integer)

        Dim ipAddr As IPAddress = Nothing
        Dim alAddrList As New ArrayList

        If pingDevice Is Nothing Then Exit Sub


        ' check address format and see if we can change it to ip if not valid
        If ipAddr.TryParse(pingDevice.devAddress, ipAddr) Then
            clsPing.PingSendAddress = pingDevice.devAddress
        Else
            ' pass in a name and get a list of candidate addresses
            alAddrList = clsPing.GetIPAddressFromName(pingDevice.devAddress)
            If alAddrList.Count > 0 Then
                ipAddr = alAddrList(0)
                clsPing.PingSendAddress = ipAddr.ToString
            Else
                Dim strNoAddrResp As String = "no ip address returned for " & vbCrLf & pingDevice.devAddress
                MsgBox(strNoAddrResp)
                Exit Sub
            End If
        End If

        Try
            ' set up the send data
            If pingDevice.devBuildBuffer = True Then
                buildPingBuffer(CStr(pingDevice.devFrameSize))
            End If

            clsPing.PingSendText = strPingBuffer
            clsPing.PingReverse = pingDevice.devReverseLookup
            clsPing.PingTimeout = pingDevice.devTimeout
            clsPing.PingTTL = pingDevice.devTTL
            clsPing.PingFragment = pingDevice.devFragment

            ' send the ping
            clsPing.sendsync()

            clsPingResult.pingIndex = intRsp
            clsPingResult.pingName = clsPing.PingRcvHost
            clsPingResult.pingAddress = clsPing.PingRcvAddress
            clsPingResult.pingTime = clsPing.PingRtTime
            clsPingResult.pingResult = clsPing.PingStatus.ToString
            clsPingResult.pingDataLen = clsPing.PingRcvSize

            If clsPingResult.pingIndex <> 0 Then
                ' new class result format
                Dim respResult As IcmpPingResults.stcPingResult
                respResult = New IcmpPingResults.stcPingResult
                With respResult
                    .pingIndex = clsPingResult.pingIndex
                    .pingName = clsPingResult.pingName
                    .pingAddress = clsPingResult.pingAddress
                    .pingTime = clsPingResult.pingTime
                    .pingResult = clsPingResult.pingResult
                    .pingDataLen = clsPingResult.pingDataLen
                End With
                clsPingResult.Add(respResult)
            End If


        Catch net As SocketException
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(net, "Network Policy")
            If (rethrow) Then
                Throw
            End If
        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub


    '
    '
    '
    Private Sub pingBasedOnSpecs()

        'Make sure the frequency and timeout values are valid
        If (Not changeTimeout()) Then Exit Sub

        pingsSubmitted = 0

        clsPingResult = Nothing
        clsPingResult = New IcmpPingResults

        'Disable the interface
        updateInterface(True)


        clsPingDevice.devFrameSize = CInt(Me.lstFrameSize.SelectedItem)
        clsPingDevice.devPingLimit = CInt(Me.txtPingLimit.Text)
        clsPingDevice.devPingSubmitted = 0
        clsPingDevice.devState = "my_ping"
        clsPingDevice.devTTL = CInt(Me.txtTTL.Text)
        clsPingDevice.devReverseLookup = Me.chkReverseLookup.Checked
        clsPingDevice.devBuildBuffer = True
        clsPingDevice.devTimeout = 1000      ' one second

        Dim intRsp As Integer = 0

        For intRsp = 1 To CInt(Me.txtPingLimit.Text)
            DoPingSync(clsPingDevice, intRsp)
        Next

        intRsp = clsPingResult.Count
        If 0 < intRsp Then
            clsPingResult.buildReportTable()

        End If


    End Sub


#End Region

#Region " Stepped Ping "

    ' the stepped ping is used to test the path to the device
    ' with a number of different message sizes. The default
    ' message size (32 bytes) for a ping often doesn't show up
    ' any of the intermittent network problems.
    Private Sub PerformSteppedPing()




        Dim iICtr As Integer
        Dim iJCtr As Integer
        Dim iTot As Integer
        Dim iError As Integer
        Dim lAvg As Int32
        Dim intCurrentSize As Integer


        Dim lngTimeout As Int32 = 2000

        ' if we already did it once get out
        If Me.strLastAutomatedTarget = Me.txtIPTarget.Text _
           And Me.strLastAutomatedTarget <> "" Then Exit Sub

        If Me.txtIPTarget.Text = "" Then
            MsgBox("TargetIP address is blank")
            Exit Sub
        End If

        Me.Cursor = Cursors.WaitCursor

        Try


            initStepPingConstants()
            clsStepPingResult.loadDlvSteppedPingResults(Me.dlvSteppedPing)

            If clsStepPingResult Is Nothing Then
                clsStepPingResult = New IcmpStepPingResult
            Else
                clsStepPingResult = Nothing
                clsStepPingResult = New IcmpStepPingResult
            End If

            Me.Cursor = Cursors.WaitCursor

            For iICtr = 0 To 8      ' message size

                iError = 0
                lAvg = 0
                intCurrentSize = arrPingBuffSize(iICtr).intPacketSize
                txtStepPingSize.Text = intCurrentSize.ToString
                System.Windows.Forms.Application.DoEvents()

                clsStepPingResult.initStepPingProperties()

                ' save the size in the output array
                clsStepPingResult.spPacketSize = CStr(intCurrentSize)
                iTot = 0
                For iJCtr = 1 To 10
                    txtStepPingCt.Text = CStr(iJCtr)
                    System.Windows.Forms.Application.DoEvents()

                    ' reset the input array

                    clsPingDevice.devTimeout = lngTimeout
                    clsPingDevice.devFrameSize = intCurrentSize
                    clsPingDevice.devBuildBuffer = True
                    clsPingDevice.devAddress = txtIPTarget.Text
                    clsPingDevice.devFragment = False
                    clsPingDevice.devTTL = 64

                    DoPingSync(clsPingDevice, 0)

                    ' was it a clean run
                    If clsPingResult.pingResult = IPStatus.Success.ToString Then
                        Select Case iJCtr
                            Case 1
                                clsStepPingResult.spDel01 = clsPingResult.pingTime
                            Case 2
                                clsStepPingResult.spDel02 = clsPingResult.pingTime
                            Case 3
                                clsStepPingResult.spDel03 = clsPingResult.pingTime
                            Case 4
                                clsStepPingResult.spDel04 = clsPingResult.pingTime
                            Case 5
                                clsStepPingResult.spDel05 = clsPingResult.pingTime
                            Case 6
                                clsStepPingResult.spDel06 = clsPingResult.pingTime
                            Case 7
                                clsStepPingResult.spDel07 = clsPingResult.pingTime
                            Case 8
                                clsStepPingResult.spDel08 = clsPingResult.pingTime
                            Case 9
                                clsStepPingResult.spDel09 = clsPingResult.pingTime
                            Case 10
                                clsStepPingResult.spDel10 = clsPingResult.pingTime
                        End Select
                        ' update the total delay
                        iTot = iTot + clsPingResult.pingTime
                        ' compute the average
                        clsStepPingResult.spTotDelay = iTot
                        clsStepPingResult.spAvgDelay = iTot / (iJCtr - iError)
                        ' for the first one we use the first time as both high and low
                        If iJCtr = 1 Then
                            clsStepPingResult.spMinDelay = clsPingResult.pingTime
                            clsStepPingResult.spMaxDelay = clsPingResult.pingTime
                        End If
                        If 1 < iJCtr Then
                            ' build the high value
                            If clsStepPingResult.spMaxDelay <= clsPingResult.pingTime Then
                                clsStepPingResult.spMaxDelay = clsPingResult.pingTime
                            End If
                            ' build the low value
                            If clsPingResult.pingTime < clsStepPingResult.spMinDelay Then
                                clsStepPingResult.spMinDelay = clsPingResult.pingTime
                            End If
                        End If


                    Else
                        ' we had an error
                        iError = iError + 1
                        clsStepPingResult.spErrorCt = iError

                        ' if we have 10 straight errors abort further testing
                        ' if message size = 2048 this is probably a MTU issue (somebody set an ethernet filter)
                        If iError = 10 Then
                            Me.chkSteppedPingEnabled.Checked = False
                            Dim strMsg As String
                            strMsg = "Ten straight errors, aborting" & vbCrLf
                            strMsg = strMsg & "PingAddress " & txtIPTarget.Text.ToString & vbCrLf
                            strMsg = strMsg & "PingSize    " & intCurrentSize.ToString & vbCrLf
                            strMsg = strMsg & "PingReturn  " & clsPingResult.pingDataLen.ToString & vbCrLf
                            strMsg = strMsg & "PingResult  " & clsPingResult.pingResult & vbCrLf
                            MsgBox(strMsg)
                            clsStepPingResult.spPingAddress = txtIPTarget.Text.ToString
                            clsStepPingResult.spErrorCt = 10
                            clsStepPingResult.addStepPingResultToCol()
                            GoTo LoadResults
                        End If
                    End If ' test for clean complete

                    If iJCtr = 10 Then

                        ' just to make sure
                        clsStepPingResult.spPingAddress = clsPingResult.pingAddress
                        clsStepPingResult.addStepPingResultToCol()

                        ' the network friendly delay counter
                        NetFriendlyDelay(1000)
                    End If
                Next iJCtr

                updateStepPingUI(txtIPTarget.Text)

            Next iICtr

LoadResults:
            Me.Cursor = Cursors.Default

            updateStepPingUI(txtIPTarget.Text)
            System.Windows.Forms.Application.DoEvents()

            chkSteppedPingEnabled.Checked = True

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

        Me.Cursor = Cursors.Default


    End Sub

    '
    '
    '
    Private Sub updateStepPingUI(ByVal strIpAddress As String)


        If Not (clsStepPingResult.dtSteppedPing Is Nothing) Then
            clsStepPingResult.dtSteppedPing = Nothing
            clsStepPingResult.dtSteppedPing = New DataTable
        Else
            clsStepPingResult.dtSteppedPing = New DataTable
        End If

        clsStepPingResult.buildReportTable()
        clsStepPingResult.loadDlvSteppedPingResults(Me.dlvSteppedPing, clsStepPingResult.dtSteppedPing)


        axchartSteppedPing.Titles("TargetIp").Text = strIpAddress
        axchartSteppedPing.DataSource = clsStepPingResult.dtSteppedPing
        axchartSteppedPing.DataBind()
        axchartSteppedPing.Invalidate()

    End Sub

    '
    ' the moveSteppedPingChartToVisio process looks at the drawing page
    ' and tries to see if the ipaddress that was just pinged
    ' is on the page.
    '
    Private Sub moveSteppedPingChartToVisio()

        Dim visShape As Microsoft.Office.Interop.Visio.Shape
        Dim objChart As Microsoft.Office.Interop.Visio.Shape


        Try

            ' what is the active document name
            Dim visDoc As Microsoft.Office.Interop.Visio.Document = drawingApplication.ActiveDocument
            Dim strDocName As String = visDoc.Name
            ' what is the initialized document name
            strDocName = drawingDocument.Name


            ' make sure we have an active drawing page
            If drawingPage Is Nothing Then Exit Sub

            ' Me.TabControl1.SelectTab(tbVisio)


            ' search the shapes for those with IpAddresses and if we find the current target
            ' paste a bmp copy of the current stepped ping chart 
            For Each visShape In drawingPage.Shapes
                If visShape.CellExists("prop.attrnetipaddress", False) Then
                    If visShape.Cells("prop.attrnetipaddress").ResultStr("") = txtIPTarget.Text Then

                        Me.Cursor = Cursors.WaitCursor

                        ' save the chart as a memory stream and put on clipboard
                        Using streamMemory As New MemoryStream()
                            axchartSteppedPing.SaveImage(streamMemory, ChartImageFormat.Bmp)
                            Dim bmpChart As New Bitmap(streamMemory)
                            Clipboard.SetImage(bmpChart)
                        End Using

                        Dim typeCurr As System.Type = My.Computer.Clipboard.GetType
                        If My.Computer.Clipboard.ContainsData(DataFormats.Bitmap) Then
                            ' copy the clipboard to the page
                            drawingPage.Paste()
                        Else
                            Exit For
                        End If

                        ' since the paste was the last one in just look at the 
                        ' end of the queue
                        Dim visCell As Microsoft.Office.Interop.Visio.Cell
                        Dim strChartName As String = "step_ping_" & txtIPTarget.Text.ToString
                        objChart = drawingPage.Shapes.Item(drawingPage.Shapes.Count)
                        objChart.Name = strChartName
                        objChart.NameU = strChartName
                        If objChart.CellsSRCExists(VisSectionIndices.visSectionObject, VisRowIndices.visRowMisc, VisCellIndices.visComment, False) = True Then
                            visCell = objChart.CellsSRC(VisSectionIndices.visSectionObject, VisRowIndices.visRowMisc, VisCellIndices.visComment)
                            m_clsvisio.SetCellValueToString(visCell, strChartName)
                        End If

                        ' this aligns us horizontally in the nodes neighborhood
                        objChart.Cells("piny").ResultIU = visShape.Cells("piny").ResultIU
                        objChart.Cells("pinx").ResultIU = visShape.Cells("pinx").ResultIU + (visShape.Cells("width").ResultIU * 1.5)

                        ' need to do a computed width because we don't know what page they may be placed on
                        objChart.Cells("width").ResultIU = visShape.Cells("width").ResultIU
                        objChart.Cells("Height").ResultIU = visShape.Cells("width").ResultIU

                        ' make sure the visio support is pointed at the correct page
                        m_clsvisio.drawingApplication = drawingApplication
                        m_clsvisio.drawingDocument = drawingDocument
                        m_clsvisio.drawingPage = drawingPage
                        m_clsvisio.AddStandardConnections(objChart)

                        Const BASIC_FLOWCHART_STENCIL As String = _
                            "Basic Flowchart Shapes (US units).vss"
                        Dim lclMaster As Microsoft.Office.Interop.Visio.Master = Nothing
                        Try
                            lclMaster = drawingDocument.Masters("Dynamic Connector")
                        Catch
                        End Try
                        Dim mstrShape As Microsoft.Office.Interop.Visio.Shape
                        If lclMaster Is Nothing Then
                            Dim stnDoc As Microsoft.Office.Interop.Visio.Document = Me.drawingApplication.Documents.OpenEx(BASIC_FLOWCHART_STENCIL, VisOpenSaveArgs.visOpenDocked + VisOpenSaveArgs.visAddHidden)
                            Dim visMaster As Microsoft.Office.Interop.Visio.Master = stnDoc.Masters("Dynamic Connector")
                            mstrShape = drawingPage.Drop(visMaster, 0, 0)
                            stnDoc.Close()
                        Else
                            mstrShape = drawingPage.Drop(lclMaster, 0, 0)
                        End If

                        Dim visCable As Microsoft.Office.Interop.Visio.Shape
                        visCable = mstrShape.Duplicate

                        Dim strNodeAConn As String
                        Dim strNodeBConn As String
                        strNodeAConn = "connections." & "Left"
                        strNodeBConn = "connections." & "Right"

                        Dim objBeginX As Microsoft.Office.Interop.Visio.Cell
                        Dim objEndX As Microsoft.Office.Interop.Visio.Cell

                        objBeginX = visCable.CellsSRC( _
                                VisSectionIndices.visSectionObject, VisRowIndices.visRowXForm1D, VisCellIndices.vis1DBeginX)
                        If objChart.CellExists(strNodeAConn, False) = True Then
                            objBeginX.GlueTo(objChart.Cells(strNodeAConn))
                        End If

                        objEndX = visCable.CellsSRC( _
                            VisSectionIndices.visSectionObject, VisRowIndices.visRowXForm1D, VisCellIndices.vis1DEndX)
                        If visShape.CellExists(strNodeBConn, False) = True Then
                            objEndX.GlueTo(visShape.Cells(strNodeBConn))
                        End If

                        drawingApplication.ActiveWindow.DeselectAll()

                        Exit For
                    End If  ' found ipaddress we just stepped through
                End If  ' found something with an IP address
            Next visShape


        Catch com As COMException
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(com, "Com+ Policy")
            If (rethrow) Then
                Throw
            End If
        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        Finally



        End Try

        Me.Cursor = Cursors.Default
        Me.Focus()
        Me.Refresh()



    End Sub





    '/ <summary>
    '/ Creates Y axis for the specified series.
    '/ </summary>
    '/ <param name="chart">Chart control.</param>
    '/ <param name="area">Original chart area.</param>
    '/ <param name="series">Series.</param>
    '/ <param name="axisOffset">New Y axis offset in relative coordinates.</param>
    '/ <param name="labelsSize">Extra space for new Y axis labels in relative coordinates.</param>
    Public Sub CreateYAxis _
        (ByVal chart As Charting.Chart, _
         ByVal area As Charting.ChartArea, _
         ByVal series As Charting.Series, _
         ByVal axisOffset As Single, _
         ByVal labelsSize As Single)

        Try



            ' Create new chart area for original series
            Dim areaSeries As Charting.ChartArea = chart.ChartAreas.Add(("ChartArea_" + series.Name))
            areaSeries.BackColor = System.Drawing.Color.Transparent
            areaSeries.BorderColor = System.Drawing.Color.Transparent
            areaSeries.Position.FromRectangleF(area.Position.ToRectangleF())
            areaSeries.InnerPlotPosition.FromRectangleF(area.InnerPlotPosition.ToRectangleF())
            areaSeries.AxisX.MajorGrid.Enabled = False
            areaSeries.AxisX.MajorTickMark.Enabled = False
            areaSeries.AxisX.LabelStyle.Enabled = False
            areaSeries.AxisY.MajorGrid.Enabled = False
            areaSeries.AxisY.MajorTickMark.Enabled = False
            areaSeries.AxisY.LabelStyle.Enabled = False
            areaSeries.AxisY.IsStartedFromZero = area.AxisY.IsStartedFromZero

            series.ChartArea = areaSeries.Name

            ' Create new chart area for axis
            Dim areaAxis As Charting.ChartArea = chart.ChartAreas.Add(("AxisY_" + series.ChartArea))
            areaAxis.BackColor = System.Drawing.Color.Transparent
            areaAxis.BorderColor = System.Drawing.Color.Transparent
            areaAxis.Position.FromRectangleF(chart.ChartAreas(series.ChartArea).Position.ToRectangleF())
            areaAxis.InnerPlotPosition.FromRectangleF(chart.ChartAreas(series.ChartArea).InnerPlotPosition.ToRectangleF())

            ' Create a copy of specified series
            Dim seriesCopy As Charting.Series = chart.Series.Add((series.Name + "_Copy"))
            seriesCopy.ChartType = series.ChartType
            Dim point As Charting.DataPoint
            For Each point In series.Points
                seriesCopy.Points.AddXY(point.XValue, point.YValues(0))
            Next point

            ' Hide copied series
            seriesCopy.IsVisibleInLegend = False
            seriesCopy.Color = System.Drawing.Color.Transparent
            seriesCopy.BorderColor = System.Drawing.Color.Transparent
            seriesCopy.ChartArea = areaAxis.Name

            ' Disable grid lines & tickmarks
            areaAxis.AxisX.LineWidth = 0
            areaAxis.AxisX.MajorGrid.Enabled = False
            areaAxis.AxisX.MajorTickMark.Enabled = False
            areaAxis.AxisX.LabelStyle.Enabled = False
            areaAxis.AxisY.MajorGrid.Enabled = False
            areaAxis.AxisY.IsStartedFromZero = area.AxisY.IsStartedFromZero

            ' Adjust area position
            areaAxis.Position.X -= axisOffset
            areaAxis.InnerPlotPosition.X += labelsSize

        Catch ex As Exception
            '********* visio snippet vb.net vis0059vb ******************
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try


    End Sub 'CreateYAxis


    '
    ' this routine allows us to manipulate the stepped ping chart as two chartareas
    '
    Private Sub Alignment()


        Try

            ' alignment is used when we do two graphareas
            GoTo ExitSub

            If AlignmentCombo.SelectedItem Is Nothing Then

                Exit Sub

            End If



            ' Vertical Alignment  

            If AlignmentCombo.GetItemText(AlignmentCombo.SelectedItem) = "Vertically" Then

                ' Set the chart area alignmnet.  This will cause the axes to align vertically.  
                axchartSteppedPing.ChartAreas("Errors").AlignmentOrientation = Charting.AreaAlignmentOrientations.Vertical

                ' Disable X Axis Labels for the first chart area.  
                axchartSteppedPing.ChartAreas("Default").AxisX.LabelStyle.Enabled = False
                axchartSteppedPing.ChartAreas("Default").AxisX.MajorTickMark.Enabled = False

                ' Enable Y axis for the second chart area  
                axchartSteppedPing.ChartAreas("Errors").AxisY.LabelStyle.Enabled = True
                axchartSteppedPing.ChartAreas("Errors").AxisY.MajorTickMark.Enabled = True

                ' Disable Y axis for the second chart area  
                axchartSteppedPing.ChartAreas("Errors").AxisY.Enabled = Charting.AxisEnabled.[True]

                ' Enable Y2 axis for the second chart area  
                axchartSteppedPing.ChartAreas("Errors").AxisY2.Enabled = Charting.AxisEnabled.[False]



                ' Disable End labels for Y axes.  
                axchartSteppedPing.ChartAreas("Default").AxisY.LabelStyle.IsEndLabelVisible = False
                axchartSteppedPing.ChartAreas("Errors").AxisY.LabelStyle.IsEndLabelVisible = False

                ' Set the chart area position for the first chart area.  
                axchartSteppedPing.ChartAreas("Default").Position.X = 5
                axchartSteppedPing.ChartAreas("Default").Position.Y = 10
                axchartSteppedPing.ChartAreas("Default").Position.Width = 85
                axchartSteppedPing.ChartAreas("Default").Position.Height = 40

                ' Set the chart area position for the second chart area.  
                axchartSteppedPing.ChartAreas("Errors").Position.X = 5
                axchartSteppedPing.ChartAreas("Errors").Position.Y = 50
                axchartSteppedPing.ChartAreas("Errors").Position.Width = 85
                axchartSteppedPing.ChartAreas("Errors").Position.Height = 40

            Else

                ' Horizontal Alignment  

                ' Set the chart area alignmnet.  This will cause the axes to align horizontally.  
                axchartSteppedPing.ChartAreas("Errors").AlignmentOrientation = Charting.AreaAlignmentOrientations.Horizontal

                ' Disable Y axis for the second chart area  
                axchartSteppedPing.ChartAreas("Errors").AxisY.LabelStyle.Enabled = False
                axchartSteppedPing.ChartAreas("Errors").AxisY.MajorTickMark.Enabled = False

                ' Disable X Axis Labels for the first chart area.  
                axchartSteppedPing.ChartAreas("Default").AxisX.LabelStyle.Enabled = True

                ' Enable Y2 axis for the second chart area  
                axchartSteppedPing.ChartAreas("Errors").AxisY2.Enabled = Charting.AxisEnabled.[True]

                ' Set axis maximum for Y axes   
                'axchartSteppedPing.ChartAreas("Default").AxisY.Maximum = 10
                axchartSteppedPing.ChartAreas("Errors").AxisY.Maximum = 10

                ' Disable end labels for X axes  
                axchartSteppedPing.ChartAreas("Default").AxisX.LabelStyle.IsEndLabelVisible = False
                axchartSteppedPing.ChartAreas("Default").AxisY.LabelStyle.IsEndLabelVisible = True
                axchartSteppedPing.ChartAreas("Errors").AxisX.LabelStyle.IsEndLabelVisible = False


                ' Set the chart area position for the first chart area.  
                axchartSteppedPing.ChartAreas("Default").Position.X = 5
                axchartSteppedPing.ChartAreas("Default").Position.Y = 10
                axchartSteppedPing.ChartAreas("Default").Position.Width = 45
                axchartSteppedPing.ChartAreas("Default").Position.Height = 80

                ' Set the chart area position for the second chart area.  
                axchartSteppedPing.ChartAreas("Errors").Position.X = 50
                axchartSteppedPing.ChartAreas("Errors").Position.Y = 10
                axchartSteppedPing.ChartAreas("Errors").Position.Width = 45
                axchartSteppedPing.ChartAreas("Errors").Position.Height = 80

            End If

        Catch ex As Exception
            '********* visio snippet vb.net vis0059vb ******************
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

ExitSub:


    End Sub


    '
    ' part of dual chartarea support
    '
    Private Sub UpdateChartSettings()




        Try


            ' If both chart areas are specified, align the chart areas  
            If (checkBoxShowChartArea2.Checked) AndAlso (checkBoxShowChartArea1.Checked) Then
                Me.AlignmentCombo.Enabled = True


                axchartSteppedPing.ChartAreas("Default").Visible = True
                axchartSteppedPing.ChartAreas("Errors").Visible = True
                Me.Alignment()

                ' If Chart Area 1 checked, Errors unchecked  
            ElseIf (Not checkBoxShowChartArea2.Checked) AndAlso (checkBoxShowChartArea1.Checked) Then
                Me.AlignmentCombo.Enabled = False


                axchartSteppedPing.ChartAreas("Errors").Visible = False
                axchartSteppedPing.ChartAreas("Default").Visible = True
                axchartSteppedPing.ChartAreas("Default").Position.Auto = True
                axchartSteppedPing.ChartAreas("Default").InnerPlotPosition.Auto = True

                ' Enable X Axis Labels for the first chart area.  
                axchartSteppedPing.ChartAreas("Default").AxisX.LabelStyle.Enabled = True
                axchartSteppedPing.ChartAreas("Default").AxisX.MajorTickMark.Enabled = True


                ' If Chart Area 1 unchecked, Errors checked  

            ElseIf (checkBoxShowChartArea2.Checked) AndAlso (Not checkBoxShowChartArea1.Checked) Then
                Me.AlignmentCombo.Enabled = False



                axchartSteppedPing.ChartAreas("Default").Visible = False
                axchartSteppedPing.ChartAreas("Errors").Visible = True
                axchartSteppedPing.ChartAreas("Errors").Position.Auto = True
                axchartSteppedPing.ChartAreas("Errors").InnerPlotPosition.Auto = True

                ' If both chart areas unchecked  
            ElseIf (Not checkBoxShowChartArea2.Checked) AndAlso (Not checkBoxShowChartArea1.Checked) Then
                Me.AlignmentCombo.Enabled = False



                axchartSteppedPing.ChartAreas("Default").Visible = False
                axchartSteppedPing.ChartAreas("Errors").Visible = False

            End If

            axchartSteppedPing.Invalidate()

        Catch ex As Exception
            '********* visio snippet vb.net vis0059vb ******************
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try



    End Sub



#End Region

#Region " Trace Route "


    Private strTraceRouteName As String = ""
    Private strTraceRouteIP As String = ""
    Private lngTraceRouteTime As Int32 = 0
    Private strTraceRouteTest As String = ""


    '
    '
    '
    Private Sub executeTraceRoute()

        ' go to the traceroute tab 
        Me.TabControl1.SelectedIndex = 3


        Dim intTTL As Integer = 0
        Dim intPING_ERROR_RETRY As Integer = 2  ' our retry limit for errors
        Dim intTR_BLOCKED_PATH As Integer = 2   ' our retry limit for blocked path
        Dim intTimeoutCt As Integer = 0
        Dim intTR_PATH_ERR As Integer = 0

        If clsTraceResult Is Nothing Then
            clsTraceResult = New IcmpTraceRouteResult
        Else
            clsTraceResult = Nothing
            clsTraceResult = New IcmpTraceRouteResult
        End If

        cmdTraceRt.Enabled = False
        ' while doing a trace rt turn off stepped ping
        Me.chkSteppedPingEnabled.Checked = False

        ' setup the device class
        clsPingDevice.devAddress = txtTraceRt_Target.Text
        clsPingDevice.devFrameSize = 16          ' short messages have higher probability of success
        clsPingDevice.devReverseLookup = True    ' we do want the name right now
        clsPingDevice.devBuildBuffer = True      ' we do want a buffer built
        clsPingDevice.devTimeout = 3000          ' three seconds, we are willing to wait on this one

        Me.Cursor = Cursors.WaitCursor

        Try

            Dim routeResult As IcmpTraceRouteResult.stcTraceRouteResult


            For intTTL = 1 To CShort(txtTTL.Text)
                routeResult = New IcmpTraceRouteResult.stcTraceRouteResult
                routeResult.trHop = intTTL - 1

                If intTR_PATH_ERR < intTR_BLOCKED_PATH Then

                    ' set ttl to hop to be tested
                    clsPingDevice.devTTL = intTTL
                    ' do the ping
                    clsPingResult = Nothing
                    clsPingResult = New IcmpPingResults
                    DoPingSync(clsPingDevice, 0)

                    System.Windows.Forms.Application.DoEvents()

                    ' first save pingresult to trace results
                    clsTraceResult.trTripTime = clsPingResult.pingTime
                    clsTraceResult.trHostName = clsPingResult.pingName
                    clsTraceResult.trHostIp = clsPingResult.pingAddress
                    clsTraceResult.trErrorStatus = clsPingResult.pingResult.ToString
                    clsTraceResult.trSecondStatus = ""

                    Select Case clsPingResult.pingResult
                        Case IPStatus.Success.ToString            ' good response, found the device
                            With routeResult
                                .trErrorStatus = IPStatus.Success.ToString
                                .trSecondStatus = clsTraceResult.trSecondStatus
                                .trHop = intTTL - 1
                                .trHostName = clsTraceResult.trHostName
                                .trHostIP = clsTraceResult.trHostIp
                                .trTripTime = clsTraceResult.trTripTime
                                .trSecondStatus = ""
                            End With
                            ' found the target leave the routine after saving the last record
                            clsTraceResult.Add(routeResult)
                            Exit For

                        Case IPStatus.TtlExpired.ToString            ' time to live expired
                            ' this is probably goodness
                            routeResult.trErrorStatus = IPStatus.TtlExpired.ToString
                            ' ping it again and get a real status with a larger ttl
                            clsPingDevice.devTTL = 64
                            ' get our target (save the current ping device address)
                            Dim tempIp As String = clsPingDevice.devAddress
                            clsPingDevice.devAddress = clsTraceResult.trHostIp
                            ' ping it again to see if a device is really there
                            clsPingResult = Nothing
                            clsPingResult = New IcmpPingResults
                            DoPingSync(clsPingDevice, 0)

                            ' put the address back
                            clsPingDevice.devAddress = tempIp
                            routeResult.trSecondStatus = clsPingResult.pingResult
                            routeResult.trTripTime = clsPingResult.pingTime
                            routeResult.trHostName = clsTraceResult.trHostName
                            routeResult.trHostIP = clsTraceResult.trHostIp
                            clsTraceResult.Add(routeResult)

                            ' we have already saved the routeresult so skip to next
                            GoTo NextTTL

                        Case IPStatus.TimedOut.ToString
                            ' this is a timeout and we can retry it
                            intTimeoutCt = intTimeoutCt + 1
                            If intTimeoutCt = intPING_ERROR_RETRY Then
                                ' log the last error
                                routeResult.trErrorStatus = IPStatus.TimedOut.ToString
                                ' leave the ttl alone
                                ' clear the error counter
                                intTimeoutCt = 0
                                intTR_PATH_ERR = intTR_PATH_ERR + 1
                            Else
                                intTTL = intTTL - 1       ' backup and retry
                                GoTo NextTTL
                            End If
                            routeResult.trSecondStatus = ""
                            routeResult.trTripTime = clsPingResult.pingTime
                            routeResult.trHostName = clsPingResult.pingName
                            routeResult.trHostIP = clsPingDevice.devAddress
                            clsTraceResult.Add(routeResult)
                            GoTo NextTTL

                        Case IPStatus.DestinationNetworkUnreachable.ToString, _
                                                IPStatus.DestinationHostUnreachable.ToString, _
                                                IPStatus.DestinationProtocolUnreachable.ToString, _
                                                IPStatus.DestinationPortUnreachable.ToString
                            ' unreachable for some reason
                            ' if we have blocked path get out
                            routeResult.trErrorStatus = "Destination Unreachable"
                            Exit For
                        Case Else

                            routeResult.trErrorStatus = clsPingResult.pingResult

                    End Select
                End If      ' test for path errors

                ' if we have too many errors get out of here
                If intTR_PATH_ERR = intTR_BLOCKED_PATH Then
                    ' add a final record for the device we're looking for
                    With routeResult
                        .trSecondStatus = ""
                        .trErrorStatus = "RouteBlocked"
                        .trHop = intTTL + 1
                        .trHostName = clsTraceResult.trHostName
                        .trHostIP = clsTraceResult.trHostIp
                        .trTripTime = 0
                    End With
                    ' route is blocked save data and get out of the loop
                    clsTraceResult.Add(routeResult)
                    Exit For
                End If

                With routeResult
                    .trErrorStatus = clsTraceResult.trErrorStatus
                    .trSecondStatus = clsTraceResult.trSecondStatus
                    .trHop = intTTL
                    .trHostName = clsTraceResult.trHostName
                    .trHostIP = clsTraceResult.trHostIp
                    .trTripTime = clsTraceResult.trTripTime
                End With
                clsTraceResult.Add(routeResult)

NextTTL:

                clsTraceResult.buildReportTable()
                clsTraceResult.loadDlvTraceRoute(Me.dlvTraceRoute, clsTraceResult.dtTraceRoute)
                Me.dlvTraceRoute.Refresh()

                System.Windows.Forms.Application.DoEvents()
            Next intTTL

            clsTraceResult.buildReportTable()
            clsTraceResult.loadDlvTraceRoute(Me.dlvTraceRoute, clsTraceResult.dtTraceRoute)
            System.Windows.Forms.Application.DoEvents()


        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If

        Finally

            Me.chkSteppedPingEnabled.Checked = True

            ' initialize the public results
            strTraceRouteName = ""
            strTraceRouteIP = ""
            lngTraceRouteTime = 0
            strTraceRouteTest = ""
            txtTTL.Text = "32"      ' return ttl to 32

        End Try

        Me.Cursor = Cursors.Default


    End Sub

    ' before we try the trace route we should make sure the device
    ' really lives out there.
    '
    Private Function TestRouteTarget(ByVal blnResp As Boolean) As Boolean
        ' initialize the public results
        strTraceRouteName = ""
        strTraceRouteIP = ""
        lngTraceRouteTime = 0
        strTraceRouteTest = ""

        ' reset the device array

        ' initialize for testing
        clsPingDevice.devAddress = txtTraceRt_Target.Text.ToString
        clsPingDevice.devFrameSize = 32          ' short messages have higher probability of success
        clsPingDevice.devTTL = CShort(txtTTL.Text) ' set same as for trace route ttl limit
        clsPingDevice.devReverseLookup = True    ' we want the name
        clsPingDevice.devBuildBuffer = True
        clsPingDevice.devTimeout = 3000          ' three seconds, we are willing to wait on this one

        clsPingResult = Nothing
        clsPingResult = New IcmpPingResults

        DoPingSync(clsPingDevice, 0)

        strTraceRouteName = clsPingResult.pingName
        lblTraceRt_Name.Text = clsPingResult.pingName
        strTraceRouteIP = clsPingResult.pingAddress
        lblTraceRt_IPAddress.Text = clsPingResult.pingAddress
        lngTraceRouteTime = clsPingResult.pingTime
        strTraceRouteTest = CStr(clsPingResult.pingResult)

        If strTraceRouteTest <> IPStatus.Success.ToString Then
            Dim strMsg As String
            strMsg = "Test Failed with " & vbCrLf
            strMsg = strMsg & strTraceRouteTest & vbCrLf
            strMsg = strMsg & clsPingResult.pingTime.ToString & vbCrLf
            strMsg = strMsg & ", Do you wish to continue?"
            If MsgBoxResult.Ok = MsgBox(strMsg, MsgBoxStyle.OkCancel, "Trace Route Test") Then
                cmdTraceRt.Enabled = True
            End If
            Return False
        Else
            If blnResp = True Then
                clsPingDevice.devAddress = clsPingResult.pingAddress
                Me.txtTraceRt_Target.Text = CStr(clsPingResult.pingAddress)
                MsgBox("Path Test Successful")
            End If
            Return True
        End If

    End Function

    '***********************************************************************
    '***********************************************************************
    ' this draws a diagram of the results from the trace route command
    ' the data it uses was created by the command and stored
    '***********************************************************************
    '***********************************************************************
    Public Sub DrawTraceRoute()


        Dim visPage As Microsoft.Office.Interop.Visio.Page
        Dim visPagesheet As Microsoft.Office.Interop.Visio.Shape

        Dim visShape As Microsoft.Office.Interop.Visio.Shape
        Dim visRect As Microsoft.Office.Interop.Visio.Shape = Nothing
        Dim visLastShape As Microsoft.Office.Interop.Visio.Shape = Nothing
        Dim visConnector As Microsoft.Office.Interop.Visio.Shape = Nothing
        Dim objBeginX As Microsoft.Office.Interop.Visio.Cell
        Dim objEndX As Microsoft.Office.Interop.Visio.Cell
        Dim visCell As Microsoft.Office.Interop.Visio.Cell

        Dim strField1 As String
        Dim strField2 As String

        Dim intI As Integer
        Dim intJ As Integer
        Dim dblP As Double          ' page width
        Dim dblB As Double          ' border width

        Dim dblIX As Double
        Dim dblIY As Double
        Dim dblMaxIX As Double
        Dim dblIH As Double
        Dim dblIW As Double

        Dim charSeparators() As Char = {"."c}
        Dim count As Integer = 4
        Dim options As StringSplitOptions = StringSplitOptions.None
        Dim returnValue As String() = {}

        Dim strValue As String = ""

        Try
            ' define a pointer
            Me.TabControl1.SelectTab(tbVisio)
            drawingWindow = axdrawTraceDisplay.Window
            _drawingDocument = Nothing
            _drawingPage = Nothing
            Try
                drawingDocument = axdrawTraceDisplay.Document
            Catch
            End Try
            If drawingDocument Is Nothing Then
                Exit Sub
            End If
            Try
                drawingPage = drawingDocument.Pages(defaultICMPPage)
            Catch
            End Try
            If drawingPage Is Nothing Then
                Exit Sub
            End If


            drawingControl.Focus()

            dblIX = 0       ' default
            dblIH = 0.3     ' default
            dblIW = 4       ' default change based on hop count
            dblB = 0.75     ' bacground border
            dblIY = dblB    ' default


            'find out how many hops are in the trace
            intJ = clsTraceResult.colTraceResults.Count

            ' if we have at least two entries (first hop and destination)
            If intJ >= 1 Then

                ' create a page
                visPage = Me.drawingApplication.ActiveDocument.Pages.Add
                visPagesheet = visPage.PageSheet
                drawingPage = visPage

                visCell = visPagesheet.Cells("PageWidth")
                m_clsvisio.SetCellValueToString(visCell, "11")
                visCell = visPagesheet.Cells("PageHeight")
                m_clsvisio.SetCellValueToString(visCell, "8.5")

                Dim docStencil As Microsoft.Office.Interop.Visio.Document = drawingApplication.Documents.OpenEx( _
                                "Basic Flowchart Shapes (US units).vss", _
                                visOpenDocked + visOpenHidden)

                Dim mstrConnector As Microsoft.Office.Interop.Visio.Master = docStencil.Masters.ItemU( _
                                "Dynamic Connector")

                ' put the trace information into the page
                CreateTraceRtPage(visPage)
                drawingPage = visPage

                dblP = visPagesheet.Cells("PageWidth").Result("")
                dblIW = (dblP - (2 * dblB)) / (intJ * 2)
                visRect = drawingPage.DrawRectangle(0, 0, dblIW, dblIH * 2)

                visCell = visRect.Cells("Char.Size")
                visCell.Formula = "=6 pt."

                m_clsvisio.ForceShapeData(visRect, "attrnetNetworkName", "", "attrNetwork")
                m_clsvisio.ForceShapeData(visRect, "attrnetIpAddress", "", "attrNetwork")
                m_clsvisio.ForceShapeData(visRect, "attrnetStatus", "", "attrNetwork")

                m_clsvisio.AddStandardConnections(visRect)

                '
                ' now read the list from the network form and draw the nodes
                '
                For intI = 0 To intJ - 1

                    strField1 = clsTraceResult.colTraceResults(intI).trHostIP
                    strField2 = clsTraceResult.colTraceResults(intI).trHostName
                    If strField2 = "" Then
                        strField2 = "nameFailed"
                    End If


                    dblIY = dblIY + (2 * dblIW)
                    dblIX = 0
                    ' now start drawing the trace
                    visShape = drawingPage.Drop(visRect, dblIY, dblIX)
                    visShape.Name = "Hop_" & CStr(intI)
                    visShape.NameU = "Hop_" & CStr(intI)
                    ' we use the ip address as marker since name may not be
                    ' available from all nodes
                    ' parse out the ip address to four lines so it looks pretty
                    returnValue = strField1.Split(charSeparators, _
                            count, options)
                    visShape.Text = returnValue(0) & vbCrLf & returnValue(1) & vbCrLf & returnValue(2) & vbCrLf & returnValue(3)

                    ' update the ip address in the rectangle
                    visCell = visShape.Cells("prop.attrnetipaddress")
                    m_clsvisio.SetCellValueToString(visCell, strField1)
                    visCell = visShape.Cells("prop.attrnetNetworkName")
                    m_clsvisio.SetCellValueToString(visCell, strField2)
                    ' move the name to the comment field
                    visCell = visShape.CellsSRC(visSectionObject, visRowMisc, visComment)
                    m_clsvisio.SetCellValueToString(visCell, strField2)

                    dblIX = dblIX - (dblIH * 2)
                    If dblIX < dblMaxIX Then
                        dblMaxIX = dblIX
                    End If
                    dblIX = dblIX - (dblIH * 2)

                    ' connect the shapes
                    If visLastShape IsNot Nothing Then
                        visConnector = drawingPage.Drop(mstrConnector, 0, 0)
                        ' put connection text in for debug
                        visConnector.Text = CStr(intI - 1) & "_" & CStr(intI)
                        objBeginX = visConnector.CellsSRC( _
                                visSectionObject, visRowXForm1D, vis1DBeginX)
                        objBeginX.GlueTo(visLastShape.Cells("connections.right"))
                        objEndX = visConnector.CellsSRC( _
                            visSectionObject, visRowXForm1D, vis1DEndX)
                        objEndX.GlueTo(visShape.Cells("connections.left"))
                    End If
                    visLastShape = visShape

                Next intI ' cycle through the list
            Else
                MsgBox("Trace route enough to justify page")
                Exit Sub
            End If      ' test for a trace route with more than an end

            ' get rid of our dummy
            visRect.Delete()

            System.Windows.Forms.Application.DoEvents()



            Dim objGroup As Microsoft.Office.Interop.Visio.Shape
            Dim objSelection As Microsoft.Office.Interop.Visio.Selection
            ' select them all
            drawingWindow.SelectAll()
            objSelection = drawingWindow.Selection
            objGroup = objSelection.Group
            objGroup.Cells("pinx").Formula = 5.5
            objGroup.Cells("piny").Formula = 4.25
            objGroup.Ungroup()
            objSelection.DeselectAll()


            ' *******************************************************************
            ' now put the data on to the sheet after we are done drawing
            ' *******************************************************************

            AddTraceRtTextBoxesToPage(visPage)

            Dim visWin As Microsoft.Office.Interop.Visio.Window
            visWin = Me.axdrawTraceDisplay.Window
            visWin.DeselectAll()

        Catch com As COMException
            '********* visio snippet vb.net vis0056vb ******************
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(com, "Com+ Policy")
            If (rethrow) Then
                Throw
            End If

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub

    ' *********************************************************************
    ' *********************************************************************
    '       Trace Route Page Setup
    ' *********************************************************************
    ' *********************************************************************
    Public Sub CreateTraceRtPage(ByVal visPage As Microsoft.Office.Interop.Visio.Page)

        Dim visWin As Microsoft.Office.Interop.Visio.Window

        Dim strTraceID As String
        Dim strPageName As String
        'Dim objBPage As Microsoft.Office.Interop.Visio.Page
        'Dim objBPageSheet As Microsoft.Office.Interop.Visio.Shape
        Dim visPagesheet As Microsoft.Office.Interop.Visio.Shape

        Dim visCell As Microsoft.Office.Interop.Visio.Cell
        Dim intJ As Integer = 0
        Dim blnResult As Boolean
        Dim strTemp As String
        Try
            ' define a pointer
            Me.TabControl1.SelectTab(tbVisio)
            axdrawTraceDisplay.Focus()
            visWin = axdrawTraceDisplay.Window

            ' make sure this trace page has a uniqueid
            strTraceID = visPage.PageSheet.UniqueID(visGetOrMakeGUID)
            ' name it for the destination node

            If lblTraceRt_Name.Text <> "" Then
                strPageName = lblTraceRt_Name.Text
            ElseIf lblTraceRt_IPAddress.Text <> "" Then
                strPageName = lblTraceRt_IPAddress.Text
            Else
                strPageName = "Null"
            End If
            visPage.Name = "Trace_" & strPageName
            visPage.Background = False

            '' now lets make sure the page looks like the rest of them
            visPagesheet = visPage.PageSheet

            'find out how many hops are in the trace
            intJ = clsTraceResult.colTraceResults.Count

            ' *****************************************************************
            ' save the trace information in custom properties on the page
            ' first create the custom propeties
            visPagesheet.AddSection(visSectionProp)
            blnResult = m_clsvisio.AddCustomProperty(visPagesheet, "TraceID", "TraceID", "TraceID", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
            blnResult = m_clsvisio.AddCustomProperty(visPagesheet, "FirstHopName", "SourceName", "SourceName", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
            blnResult = m_clsvisio.AddCustomProperty(visPagesheet, "FirstHopIP", "SourceIP", "SourceIP", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
            blnResult = m_clsvisio.AddCustomProperty(visPagesheet, "DestName", "DestName", "DestName", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
            blnResult = m_clsvisio.AddCustomProperty(visPagesheet, "DestIP", "DestIP", "DestIP", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
            blnResult = m_clsvisio.AddCustomProperty(visPagesheet, "Date", "Date", "Date", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
            blnResult = m_clsvisio.AddCustomProperty(visPagesheet, "NodeCt", "NodeCt", "NodeCt", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
            System.Windows.Forms.Application.DoEvents()
            ' *****************************************************************
            ' now populate the custom properties
            visCell = visPagesheet.Cells("prop.TraceID")
            m_clsvisio.SetCellValueToString(visCell, strTraceID)
            visCell = visPagesheet.Cells("prop.firsthopname")
            m_clsvisio.SetCellValueToString(visCell, _
                clsTraceResult.colTraceResults(0).trHostName.ToString)
            visCell = visPagesheet.Cells("prop.firsthopip")
            m_clsvisio.SetCellValueToString(visCell, _
                clsTraceResult.colTraceResults(0).trHostIP.ToString)
            visCell = visPagesheet.Cells("prop.destname")
            If clsTraceResult.colTraceResults(intJ - 1).trHostName <> "" Then
                m_clsvisio.SetCellValueToString(visCell, _
                    clsTraceResult.colTraceResults(intJ - 1).trHostName.ToString)
            Else
                m_clsvisio.SetCellValueToString(visCell, "Null")
            End If
            If visPagesheet.CellExists("prop.destip", False) Then
                visCell = visPagesheet.Cells("prop.destip")
                If clsTraceResult.colTraceResults(intJ - 1).trHostIP = Nothing Then
                    m_clsvisio.SetCellValueToString(visCell, "")
                Else
                    strTemp = clsTraceResult.colTraceResults(intJ - 1).trHostIP.ToString
                    m_clsvisio.SetCellValueToString(visCell, strTemp)
                End If
            End If
            visCell = visPagesheet.Cells("prop.date")
            m_clsvisio.SetCellValueToString(visCell, CStr(Now))
            visCell = visPagesheet.Cells("prop.nodect")
            m_clsvisio.SetCellValueToString(visCell, Str(intJ))
            System.Windows.Forms.Application.DoEvents()


        Catch com As COMException
            '********* visio snippet vb.net vis0056vb ******************
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(com, "Com+ Policy")
            If (rethrow) Then
                Throw
            End If

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try



    End Sub

    '***********************************************************************
    '***********************************************************************
    ' add the node endpoint data to the page
    '***********************************************************************
    '***********************************************************************
    Public Sub AddTraceRtTextBoxesToPage(ByVal visPage As Microsoft.Office.Interop.Visio.Page)

        Dim visRect As Microsoft.Office.Interop.Visio.Shape
        Dim blnResult As Boolean
        Dim intRowCtr As Integer
        Dim iEnd As Double
        Dim iTop As Double
        Dim iStart As Double
        Dim iBottom As Double

        iStart = 0.75
        iEnd = iStart + 3.5


        Try
            For intRowCtr = 0 To 4

                iTop = 8 - (intRowCtr * 0.2)
                iBottom = iTop - 0.2

                Select Case intRowCtr
                    Case 0
                        visRect = visPage.DrawRectangle(iStart, iTop, iEnd, iBottom)
                        visRect.Cells("Para.HorzAlign").Formula = visHorzLeft
                        blnResult = m_clsvisio.AddTextFieldToShape(visRect, _
                                "TraceID : ", _
                                "ThePage!Prop.TraceID", _
                                visFmtStrNormal)

                        System.Windows.Forms.Application.DoEvents()
                    Case 1
                        visRect = visPage.DrawRectangle(iStart, iTop, iEnd, iBottom)
                        visRect.Cells("Para.HorzAlign").Formula = visHorzLeft
                        blnResult = m_clsvisio.AddTextFieldToShape(visRect, _
                                        "FirstHopName : ", _
                                        "ThePage!Prop.FirstHopName", _
                                        visFmtStrNormal)

                        System.Windows.Forms.Application.DoEvents()
                    Case 2
                        visRect = visPage.DrawRectangle(iStart, iTop, iEnd, iBottom)
                        visRect.Cells("Para.HorzAlign").Formula = visHorzLeft
                        blnResult = m_clsvisio.AddTextFieldToShape(visRect, _
                                        "FirstHopIP : ", _
                                        "ThePage!Prop.FirstHopIP", _
                                        visFmtStrNormal)
                        System.Windows.Forms.Application.DoEvents()
                    Case 3
                        visRect = visPage.DrawRectangle(iStart, iTop, iEnd, iBottom)
                        visRect.Cells("Para.HorzAlign").Formula = visHorzLeft
                        blnResult = m_clsvisio.AddTextFieldToShape(visRect, _
                                        "DestName : ", _
                                        "ThePage!Prop.DestName", _
                                        visFmtStrNormal)
                        System.Windows.Forms.Application.DoEvents()
                    Case 4
                        visRect = visPage.DrawRectangle(iStart, iTop, iEnd, iBottom)
                        visRect.Cells("Para.HorzAlign").Formula = visHorzLeft
                        blnResult = m_clsvisio.AddTextFieldToShape(visRect, _
                                        "DestIP : ", _
                                        "ThePage!Prop.DestIP", _
                                        visFmtStrNormal)

                        System.Windows.Forms.Application.DoEvents()
                End Select

            Next intRowCtr

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try


    End Sub




#End Region

#Region " form controls and events "

    '
    '
    '
    Private Sub updateInterface(ByVal busy As Boolean)
        'Disable interface when control is busy
        txtIPTarget.Enabled = Not busy
        txtTimeout.Enabled = Not busy
        txtPingLimit.Enabled = Not busy
        txtTTL.Enabled = Not busy
        lstFrameSize.Enabled = Not busy


        If (busy) Then
            cmdStart.Text = "Stop"
        Else
            cmdStart.Text = "Ping"
        End If
    End Sub

    '
    '
    '
    Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click
        Me.Close()
    End Sub

    '
    '
    '
    Private Sub cmdTRReport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdTRReport.Click
        '
        ' make a dataset/datatable out of the structured array
        '
        Try

            Dim frmExport As frmReportViewer = New frmReportViewer(visRackSysMgmt.clsDC_RackReporting.baseReports.rptIcmpTraceRoute, clsTraceResult.dtTraceRoute)
            frmExport.ShowDialog()
            frmExport.Dispose()
            frmExport = Nothing

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub

    '
    '
    '
    Private Sub cmdPanZoom_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdPanZoom.Click
        drawingApplication.DoCmd(visCmdPanZoom)
    End Sub

    '
    '
    '
    Private Sub cmdCopyVisio_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCopyVisio.Click
        Dim clsSS As New visRackSysMgmt.ScreenScrape
        Try
            clsSS.CaptureWindowToClipboard(axdrawTraceDisplay)
            clsSS = Nothing

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub

    '
    '
    '
    Private Sub cmdStart_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click

        If (cmdStart.Text = "Ping") Then

            ' initialize for testing
            clsPingDevice.devAddress = txtIPTarget.Text.ToString

            Dim dtTemp As DataTable = New DataTable
            pingBasedOnSpecs()

            clsPingResult.loadDLVPingResults(Me.dlvPingResult, clsPingResult.dtPingResult)
            System.Windows.Forms.Application.DoEvents()

            updateInterface(False)
            Me.TabControl1.SelectTab(tbPingConf)

        Else
            updateInterface(False)
        End If


    End Sub

    '
    '
    '
    Private Sub cmdSteppedPing_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSteppedPing.Click

        Try
            ' if we do it manual reset the last flag device
            Me.strLastAutomatedTarget = ""

            If chkSteppedPingEnabled.Checked = True Then
                chkSteppedPingEnabled.Checked = False
                Me.TabControl1.SelectTab(tbSteppedPing)
                System.Windows.Forms.Application.DoEvents()
                PerformSteppedPing()
            Else
                MsgBox("Stepped Ping already running")
                System.Windows.Forms.Application.DoEvents()
            End If

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try


    End Sub

    '
    '
    '
    Private Sub cmdTestPath_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTestPath.Click

        ' should test before we allow the trace route
        dlvTraceRoute.Clear()
        lblTraceRt_Name.Text = ""
        lblTraceRt_IPAddress.Text = ""
        If TestRouteTarget(True) Then cmdTraceRt.Enabled = True

    End Sub

    '
    '
    '
    Private Sub cmdTraceRt_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTraceRt.Click

        Me.TabControl1.SelectTab(tbTraceRt)
        System.Windows.Forms.Application.DoEvents()

        executeTraceRoute()

        ' this calls the addon reporting functions for 
        ' trace route
        If chkDrawTrace.Checked = True Then
            DrawTraceRoute()
            System.Windows.Forms.Application.DoEvents()
        End If

        ' if we draw the stuff we have to come back here
        Me.Focus()

        MsgBox("Trace route Complete")


    End Sub

    '
    '
    '
    Private Sub cmdUpdateNetStatus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUpdateNetStatus.Click

        ' get the selected devices from the active page
        loadNetworkShapesSelectedList()

        Dim iListCt As Integer = 0
        Dim iICtr As Integer = 0
        Dim iLayCt As Integer = 0
        Dim iErrCt As Integer = 0
        Dim iRetryCt As Integer = 5
        Dim strSelectedIP As String = ""
        Dim strSelectedObject As String = ""
        Dim strValue As String = ""

        Dim objcell As Microsoft.Office.Interop.Visio.Cell = Nothing
        Dim objShape As Microsoft.Office.Interop.Visio.Shape = Nothing
        Dim objPage As Microsoft.Office.Interop.Visio.Page = Nothing
        Dim objLayer As Microsoft.Office.Interop.Visio.Layer = Nothing
        Dim tgtLayer As Microsoft.Office.Interop.Visio.Layer = Nothing
        Dim objLayers As Microsoft.Office.Interop.Visio.Layers = Nothing
        Dim strStatus As String = ""
        Dim intStatus As dc_Network.netStatus = dc_Network.netStatus.netUndefined

        Dim intCompKey As Int32 = -1
        Dim dtTemp As DataTable = New DataTable

        Try

            ' the performance hits
            drawingApplication.ActiveWindow.DeselectAll()

            drawingApplication.DeferRecalc = True
            drawingApplication.InhibitSelectChange = True
            drawingApplication.ScreenUpdating = False

            iListCt = Me.dlvSelectedShapes.Items.Count
            ' override the ping limit
            Me.txtPingLimit.Text = iRetryCt
            Dim itemView As ListViewItem
            Me.Cursor = Cursors.WaitCursor
            If 0 < iListCt Then
                objPage = drawingApplication.ActivePage
                Dim strPageName As String = objPage.NameU

                ' we need the network class to support status aware on the drawing
                If clsNetwork Is Nothing Then
                    clsNetwork = New visRackSysMgmt.clsAttrNetwork(drawingApplication, drawingDocument)
                Else
                    clsNetwork = Nothing
                    clsNetwork = New visRackSysMgmt.clsAttrNetwork(drawingApplication, drawingDocument)
                End If

                objLayers = objPage.Layers
                For iICtr = 0 To iListCt - 1

                    intStatus = dc_Network.netStatus.netUndefined
                    strSelectedIP = ""
                    strSelectedObject = ""
                    strValue = ""
                    txtIPTarget.Text = ""

                    If (Me.dlvSelectedShapes.Items.Item(iICtr).SubItems(1).ToString <> "") Then

                        strSelectedObject = Me.dlvSelectedShapes.Items(iICtr).Text
                        strSelectedIP = Me.dlvSelectedShapes.Items(iICtr).SubItems(1).Text

                        Me.StatusLabel1.Text = "testing " & strSelectedIP & " (" & strSelectedObject & ")"
                        ' set up the ping panel for who we want to play with
                        Me.txtIPTarget.Text = strSelectedIP
                        objShape = objPage.Shapes(strSelectedObject)
                        ' even though the attrnetwork table has an attrnetcompkey
                        ' we will use the key placed in by the comp class
                        If objShape.CellExists("prop.compkey", False) = True Then
                            objcell = objShape.Cells("prop.compkey")
                            intCompKey = CInt(objcell.ResultIU)
                        Else
                            intCompKey = -1
                        End If

                        ' we should only be here if the device is not passive
                        ' so an address of 0.0.0.0 is an incorrect one (default)
                        If strSelectedIP = "0.0.0.0" Then
                            tgtLayer = objLayers.Item(dc_Network.netStatus.netUndefined.ToString)
                            intCompKey = -1
                            If objShape.CellExists("prop.attrnetStatus", False) Then
                                objcell = objShape.Cells("prop.attrnetStatus")
                                strStatus = dc_Network.netStatus.netUndefined
                                m_clsvisio.SetCellValueToString(objcell, strStatus)
                            End If ' test for netstatus
                            If objShape.LayerCount <> 0 Then
                                For iLayCt = objShape.LayerCount To 1 Step -1
                                    objLayer = objShape.Layer(iLayCt)
                                    objLayer.Remove(objShape, 0)
                                Next iLayCt
                            End If
                            tgtLayer.Add(objShape, 0)

                            GoTo nextselection
                        End If  ' test for blank address

                        ' we use 911 in the IpAddress field as a flag that something is wrong with the
                        ' device (usually we are flagging that something will be configured in the future)
                        If strSelectedIP = "911" Then
                            tgtLayer = objLayers.Item(dc_Network.netStatus.netErrors.ToString)
                            intCompKey = -1
                            If objShape.CellExists("prop.attrnetStatus", False) = True Then
                                objcell = objShape.Cells("prop.attrnetStatus")
                                intStatus = dc_Network.netStatus.netErrors
                                m_clsvisio.SetCellValueToString(objcell, CStr(intStatus))
                            End If ' test for netstatus
                            If objShape.LayerCount <> 0 Then
                                For iLayCt = objShape.LayerCount To 1 Step -1
                                    objLayer = objShape.Layer(iLayCt)
                                    objLayer.Remove(objShape, 0)
                                Next iLayCt
                            End If
                            tgtLayer.Add(objShape, 0)

                            GoTo nextselection
                        End If  ' test for null address

                        If strSelectedIP = "127.0.0.1" Then
                            intCompKey = -1
                        End If

                        dtTemp.Clear()
                        clsPingDevice.devAddress = strSelectedIP

                        pingBasedOnSpecs()

                        Dim Query = From result In clsPingResult.dtPingResult.AsEnumerable() _
                                Where result!pingresult IsNot DBNull.Value

                        iErrCt = iRetryCt
                        Dim strResult As String = ""
                        For Each p In Query
                            strResult = p.Field(Of String)("pingResult")
                            If strResult = "Success" Then
                                iErrCt = iErrCt - 1
                            End If
                        Next

                        ' clear any layer information from the shape
                        objShape.CellsSRC(VisSectionIndices.visSectionObject, VisRowIndices.visRowLayerMem, VisCellIndices.visLayerMember).FormulaForceU = """"""

                        Select Case iErrCt
                            ' now assign the shape to the appropriate layer
                            Case 0
                                intStatus = dc_Network.netStatus.netAvailable
                                If objShape.CellExists("prop.attrnetStatus", False) = True Then
                                    objcell = objShape.Cells("prop.attrnetStatus")
                                    m_clsvisio.SetCellValueToString(objcell, CStr(intStatus))
                                End If
                                Exit Select
                            Case iRetryCt
                                intStatus = dc_Network.netStatus.netUnavailable
                                If objShape.CellExists("prop.attrnetStatus", False) = True Then
                                    objcell = objShape.Cells("prop.attrnetStatus")
                                    m_clsvisio.SetCellValueToString(objcell, CStr(intStatus))
                                End If
                                Exit Select
                            Case iErrCt < iRetryCt
                                intStatus = dc_Network.netStatus.netErrors
                                If objShape.CellExists("prop.attrnetStatus", False) = True Then
                                    objcell = objShape.Cells("prop.attrnetStatus")
                                    m_clsvisio.SetCellValueToString(objcell, CStr(intStatus))
                                End If
                                Exit Select
                            Case Else
                                intStatus = dc_Network.netStatus.netUndefined
                                If objShape.CellExists("prop.attrnetStatus", False) = True Then
                                    objcell = objShape.Cells("prop.attrnetStatus")
                                    m_clsvisio.SetCellValueToString(objcell, CStr(intStatus))
                                End If
                        End Select

                        ' add the device to the correct layer
                        strStatus = [Enum].GetName(GetType(dc_Network.netStatus), intStatus)
                        tgtLayer = objLayers.Item(strStatus)
                        tgtLayer.Add(objShape, 0)

nextselection:

                        ' update status in form and database 
                        itemView = Me.dlvSelectedShapes.FindItemWithText(objShape.Name)
                        dlvSelectedShapes.Refresh()
                        itemView.SubItems(2).Text = strStatus
                        dlvSelectedShapes.Refresh()

                        If strPageName <> "Test Rack" Then
                            clsNetwork.dbUpdateComponentNetworkStatus(intCompKey, intStatus)
                        End If

                    End If  ' test for checked resource
                Next iICtr
            Else
                MsgBox("None Selected")
            End If



        Catch com As COMException
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(com, "Com+ Policy")
            If (rethrow) Then
                Throw
            End If
        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        Finally
            Me.Cursor = Cursors.Default
        End Try

        If Not (clsNetwork Is Nothing) Then
            clsNetwork = Nothing
        End If

        drawingApplication.ScreenUpdating = True
        drawingApplication.InhibitSelectChange = False
        drawingApplication.DeferRecalc = False
        Me.StatusLabel1.Text = ""
        System.Windows.Forms.Application.DoEvents()

        drawingApplication.ActiveWindow.DeselectAll()
        MsgBox("Status Update complete")
        Me.Close()

    End Sub


    '
    ' take the stepped ping datatable and pass it to the report processor form
    '
    Private Sub cmdCopyChart_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBuildSpReport.Click

        Try
            Dim intReport As visRackSysMgmt.clsDC_RackReporting.baseReports
            If Me.optTable.Checked = True Then
                intReport = visRackSysMgmt.clsDC_RackReporting.baseReports.rptIcmpStepPing
            End If
            If Me.optChart.Checked = True Then
                intReport = visRackSysMgmt.clsDC_RackReporting.baseReports.rptIcmpChartStepPing
            End If

            Dim frmExport As frmReportViewer = New frmReportViewer(intReport, clsStepPingResult.dtSteppedPing)
            frmExport.ShowDialog()
            frmExport.Dispose()
            frmExport = Nothing

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try


    End Sub

    '
    '
    '
    Private Sub dlvTraceRoute_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dlvTraceRoute.SelectedIndexChanged

        Dim intSelectionIndex As Integer = 0
        Dim strTargetIP As String = ""
        Dim sbResp As New StringBuilder

        Try
            Me.txtIPTarget.Text = ""
            Me.dlvPingResult.Clear()

            ' should only be one selected, get out otherwise
            If dlvTraceRoute.SelectedIndices.Count <> 1 Then Exit Sub
            intSelectionIndex = dlvTraceRoute.SelectedIndices(0)
            strTargetIP = clsTraceResult.colTraceResults(intSelectionIndex).trHostIP.ToString

            ' if we already did it get out
            If strTargetIP = strLastAutomatedTarget Then Exit Sub

            Dim msgResponse As MsgBoxResult
            Dim strMsg As String = "Link= " & CStr(intSelectionIndex + 1) & vbCrLf & "Address= " & strTargetIP
            msgResponse = MsgBox(strMsg, MsgBoxStyle.OkCancel, "Continue?")
            If msgResponse = MsgBoxResult.Cancel Then Exit Sub
            ' reset the command array

            clsPingDevice.devAddress = strTargetIP
            clsPingDevice.devFrameSize = 32          ' short messages have higher probability of success
            clsPingDevice.devTTL = 64
            clsPingDevice.devReverseLookup = True    ' we want the name
            clsPingDevice.devBuildBuffer = True
            clsPingDevice.devTimeout = 3000          ' three seconds, we are willing to wait on this one

            clsPingResult = Nothing
            clsPingResult = New IcmpPingResults
            DoPingSync(clsPingDevice, 0)

            strTraceRouteTest = CStr(clsPingResult.pingResult)

            If strTraceRouteTest <> IPStatus.Success.ToString Then
                sbResp.Append("Test path failed with " & vbCrLf)
                sbResp.Append("Target IP " & strTargetIP & vbCrLf)
                sbResp.Append("Error Code " & clsPingResult.pingResult & vbCrLf)
                sbResp.Append("Resp Time " & clsPingResult.pingTime.ToString & vbCrLf)
                MsgBox(sbResp.ToString)
                Exit Sub
            End If

            ' move to setup and put in the ip address 
            Me.TabControl1.SelectTab(tbNetStatus)
            txtIPTarget.Text = strTargetIP
            System.Windows.Forms.Application.DoEvents()
            ' move to stepped ping and start ping
            Me.TabControl1.SelectTab(tbSteppedPing)
            System.Windows.Forms.Application.DoEvents()

            PerformSteppedPing()

            ' since we performed it we should flag it
            strLastAutomatedTarget = strTargetIP


        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub

    '
    '
    '
    Private Sub AlignmentCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        'Alignment()
    End Sub

    '
    '
    '
    Private Sub checkBoxShowChartArea1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        'UpdateChartSettings()
    End Sub

    '
    '
    '
    Private Sub checkBoxShowChartArea2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        'UpdateChartSettings()
    End Sub

    '
    '
    '
    Private Sub frmICMPMgmt_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        AlignmentCombo.SelectedIndex = 0
        'Alignment()

    End Sub

    '
    '
    '
    Private Sub cmdCopySpChart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCopySpChart.Click
        moveSteppedPingChartToVisio()
    End Sub


#End Region

    '
    '
    '
    Private Sub frmICMPMgmt_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated

        Me.Text = APPNAME
        changeTimeout()
        pingsSubmitted = 0

        If Not (drawingApplication Is Nothing) Then
            loadNetworkShapesSelectedList()
        End If

        'UpdateChartSettings()

    End Sub

    '
    '
    '
    Protected Overrides Sub Finalize()

        clsPing = Nothing
        clsPingResult = Nothing
        clsStepPingResult = Nothing
        clsPingDevice = Nothing

        m_clsvisio = Nothing


        System.GC.Collect()

        MyBase.Finalize()

    End Sub





End Class


